@@ -727,6 +727,7 @@ impl ServerActor {
727
727
) ;
728
728
729
729
self . device_manager . await_streams ( & self . streams [ 0 ] ) ;
730
+ self . device_manager . await_streams ( & self . streams [ 1 ] ) ;
730
731
731
732
// Iterate over a list of tracing payloads, and create logs with mappings to
732
733
// payloads Log at least a "start" event using a log with trace.id
@@ -967,12 +968,8 @@ impl ServerActor {
967
968
} )
968
969
. unwrap ( ) ;
969
970
970
- // Wait for all streams before get timings
971
- self . device_manager . await_streams ( & self . streams [ 0 ] ) ;
972
- self . device_manager . await_streams ( & self . streams [ 1 ] ) ;
973
-
974
971
// Reset the results buffers for reuse
975
- for dst in & [
972
+ for dst in [
976
973
& self . db_match_list_left ,
977
974
& self . db_match_list_right ,
978
975
& self . batch_match_list_left ,
@@ -981,26 +978,19 @@ impl ServerActor {
981
978
reset_slice ( self . device_manager . devices ( ) , dst, 0 , & self . streams [ 0 ] ) ;
982
979
}
983
980
984
- reset_slice (
985
- self . device_manager . devices ( ) ,
981
+ for dst in [
982
+ & self . distance_comparator . all_matches ,
986
983
& self . distance_comparator . match_counters ,
987
- 0 ,
988
- & self . streams [ 0 ] ,
989
- ) ;
990
-
991
- reset_slice (
992
- self . device_manager . devices ( ) ,
993
984
& self . distance_comparator . match_counters_left ,
994
- 0 ,
995
- & self . streams [ 0 ] ,
996
- ) ;
997
-
998
- reset_slice (
999
- self . device_manager . devices ( ) ,
1000
985
& self . distance_comparator . match_counters_right ,
1001
- 0 ,
1002
- & self . streams [ 0 ] ,
1003
- ) ;
986
+ & self . distance_comparator . partial_results_left ,
987
+ & self . distance_comparator . partial_results_right ,
988
+ ] {
989
+ reset_slice ( self . device_manager . devices ( ) , dst, 0 , & self . streams [ 0 ] ) ;
990
+ }
991
+
992
+ self . device_manager . await_streams ( & self . streams [ 0 ] ) ;
993
+ self . device_manager . await_streams ( & self . streams [ 1 ] ) ;
1004
994
1005
995
// ---- END RESULT PROCESSING ----
1006
996
if self . enable_debug_timing {
@@ -1167,7 +1157,7 @@ impl ServerActor {
1167
1157
let chunk_sizes = |chunk_idx : usize | {
1168
1158
self . current_db_sizes
1169
1159
. iter ( )
1170
- . map ( |s| ( s - DB_CHUNK_SIZE * chunk_idx) . clamp ( 1 , DB_CHUNK_SIZE ) )
1160
+ . map ( |s| ( s - DB_CHUNK_SIZE * chunk_idx) . clamp ( 0 , DB_CHUNK_SIZE ) )
1171
1161
. collect :: < Vec < _ > > ( )
1172
1162
} ;
1173
1163
@@ -1220,7 +1210,7 @@ impl ServerActor {
1220
1210
// later.
1221
1211
let dot_chunk_size = chunk_size
1222
1212
. iter ( )
1223
- . map ( |s| s . div_ceil ( 64 ) * 64 )
1213
+ . map ( |& s| ( s . max ( 1 ) . div_ceil ( 64 ) * 64 ) )
1224
1214
. collect :: < Vec < _ > > ( ) ;
1225
1215
1226
1216
// First stream doesn't need to wait
0 commit comments