mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 07:36:10 -04:00
Internal change
PiperOrigin-RevId: 370725774
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user