File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -417,6 +417,16 @@ bool LocalStore::ShouldPersistTargetData(const TargetData& new_target_data,
417417 int64_t time_delta = new_seconds - old_seconds;
418418 if (time_delta >= kResumeTokenMaxAgeSeconds ) return true ;
419419
420+ // Update the target cache if sufficient time has passed since the last
421+ // LastLimboFreeSnapshotVersion
422+ int64_t new_limbo_free_seconds =
423+ new_target_data.last_limbo_free_snapshot_version ().timestamp ().seconds ();
424+ int64_t old_limbo_free_seconds =
425+ old_target_data.last_limbo_free_snapshot_version ().timestamp ().seconds ();
426+ int64_t limbo_free_time_delta =
427+ new_limbo_free_seconds - old_limbo_free_seconds;
428+ if (limbo_free_time_delta >= kResumeTokenMaxAgeSeconds ) return true ;
429+
420430 // Otherwise if the only thing that has changed about a target is its resume
421431 // token then it's not worth persisting. Note that the RemoteStore keeps an
422432 // in-memory view of the currently active targets which includes the current
@@ -465,6 +475,10 @@ void LocalStore::NotifyLocalViewChanges(
465475 target_data.WithLastLimboFreeSnapshotVersion (
466476 last_limbo_free_snapshot_version);
467477 target_data_by_target_[target_id] = updated_target_data;
478+
479+ if (ShouldPersistTargetData (updated_target_data, target_data, {})) {
480+ target_cache_->UpdateTarget (updated_target_data);
481+ }
468482 }
469483 }
470484 });
You can’t perform that action at this time.
0 commit comments