Internal bug fix

PiperOrigin-RevId: 522474442
This commit is contained in:
Guogang Li
2023-04-06 17:03:47 -07:00
committed by Copybara-Service
parent 5d4cf93aed
commit 87e044fa89
3 changed files with 17 additions and 2 deletions
@@ -92,7 +92,18 @@ bool Timer::FireNow() {
return false;
}
callback_();
if (task_executor_ == nullptr) {
task_executor_ = std::make_unique<SubmittableExecutor>();
}
if (task_executor_ == nullptr) {
NEARBY_LOGS(ERROR)
<< "Failed to fire the task due to cannot create executor.";
return false;
}
task_executor_->Execute([&]() { callback_(); });
return true;
}