@@ -363,18 +363,18 @@ private CompletableFuture<Void> setIndexingTypeOrThrow(FDBRecordStore store, boo
363
363
IndexBuildProto .IndexBuildIndexingStamp indexingTypeStamp = getIndexingTypeStamp (store );
364
364
heartbeat = new IndexingHeartbeat (common .getIndexerId (), indexingTypeStamp .getMethod (), common .config .getLeaseLengthMillis ());
365
365
366
- return forEachTargetIndex (index -> setIndexingTypeOrThrow (store , continuedBuild , index , indexingTypeStamp ));
366
+ return forEachTargetIndex (index -> setIndexingTypeOrThrow (store , continuedBuild , index , indexingTypeStamp )
367
+ .thenApply (ignore -> updateHeartbeat (true , store , index )));
367
368
}
368
369
369
370
@ Nonnull
370
371
private CompletableFuture <Void > setIndexingTypeOrThrow (FDBRecordStore store , boolean continuedBuild , Index index , IndexBuildProto .IndexBuildIndexingStamp newStamp ) {
371
- final CompletableFuture <Void > checkUpdateHeartbeat = updateHeartbeat (true , store , index );
372
372
if (forceStampOverwrite && !continuedBuild ) {
373
373
// Fresh session + overwrite = no questions asked
374
374
store .saveIndexingTypeStamp (index , newStamp );
375
- return checkUpdateHeartbeat ;
375
+ return AsyncUtil . DONE ;
376
376
}
377
- return checkUpdateHeartbeat . thenCompose ( ignore -> store .loadIndexingTypeStampAsync (index )
377
+ return store .loadIndexingTypeStampAsync (index )
378
378
.thenCompose (savedStamp -> {
379
379
if (savedStamp == null ) {
380
380
if (continuedBuild && newStamp .getMethod () !=
@@ -416,7 +416,7 @@ private CompletableFuture<Void> setIndexingTypeOrThrow(FDBRecordStore store, boo
416
416
}
417
417
// fall down to exception
418
418
throw newPartlyBuiltException (continuedBuild , savedStamp , newStamp , index );
419
- })) ;
419
+ });
420
420
}
421
421
422
422
private boolean shouldAllowTypeConversionContinue (IndexBuildProto .IndexBuildIndexingStamp newStamp , IndexBuildProto .IndexBuildIndexingStamp savedStamp ) {
0 commit comments