Internal change

PiperOrigin-RevId: 370725774
This commit is contained in:
hai007
2021-04-27 11:29:54 -07:00
committed by Copybara-Service
parent a45898859b
commit d9da18414a
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -63,9 +63,9 @@ void PendingJobRegistry::RemoveRunningJob(const std::string& name,
void PendingJobRegistry::ListJobs() {
auto current_time = SystemClock::ElapsedRealtime();
MutexLock lock(&mutex_);
if (current_time - list_jobs_time_ < kMinReportInterval)
return;
MutexLock lock(&mutex_);
for (auto& job : pending_jobs_) {
auto age = current_time - job.second;
if (age >= kReportPendingJobsOlderThan) {
+1 -1
View File
@@ -46,7 +46,7 @@ class PendingJobRegistry {
ABSL_GUARDED_BY(mutex_);
absl::flat_hash_map<const std::string, absl::Time> running_jobs_
ABSL_GUARDED_BY(mutex_);
absl::Time list_jobs_time_ = absl::UnixEpoch();
absl::Time list_jobs_time_ ABSL_GUARDED_BY(mutex_) = absl::UnixEpoch();
};
} // namespace nearby