Fixed an issue in scheduled executor

PiperOrigin-RevId: 533306328
This commit is contained in:
Guogang Li
2023-05-18 18:10:48 -07:00
committed by Copybara-Service
parent 20ca9e282b
commit fee648aa91
@@ -62,7 +62,7 @@ class ScheduledExecutor : public api::ScheduledExecutor {
: task_(std::move(task)), duration_(duration) {}
bool Cancel() override {
if (is_executed_) {
if (is_executed_ || is_cancelled_) {
return false;
}