File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -290,6 +290,12 @@ export class RedisDedupeIndex {
290290
291291 async commitDedupeDone ( crawlId ?: string ) {
292292 crawlId = crawlId || this . crawlId ;
293+
294+ // set this first, as crawl is considered 'committed' as soon
295+ // as data is partially merged in
296+ await this . dedupeRedis . srem ( DUPE_UNCOMMITTED , crawlId ) ;
297+ await this . dedupeRedis . sadd ( DUPE_ALL_CRAWLS , crawlId ) ;
298+
293299 for await ( const hashes of this . dedupeRedis . hscanStream ( `h:${ crawlId } ` ) ) {
294300 let isValue = false ;
295301 for ( const hash of hashes ) {
@@ -316,10 +322,6 @@ export class RedisDedupeIndex {
316322 }
317323 }
318324
319- // add to crawls list
320- await this . dedupeRedis . srem ( DUPE_UNCOMMITTED , crawlId ) ;
321- await this . dedupeRedis . sadd ( DUPE_ALL_CRAWLS , crawlId ) ;
322-
323325 // add counts
324326 await this . addCrawlCounts ( crawlId ) ;
325327 }
You can’t perform that action at this time.
0 commit comments