mirror of
https://github.com/esphome/esphome.git
synced 2025-08-06 10:27:49 +00:00
cleanup
This commit is contained in:
parent
2a15f35e9d
commit
8e8ef83780
@ -143,7 +143,8 @@ void HOT Scheduler::set_timer_common_(Component *component, SchedulerItem::Type
|
|||||||
// Cancel existing items
|
// Cancel existing items
|
||||||
this->cancel_item_locked_(component, name_cstr, type);
|
this->cancel_item_locked_(component, name_cstr, type);
|
||||||
}
|
}
|
||||||
// Add new item directly to to_add_ (not using push_ to avoid double-locking)
|
// Add new item directly to to_add_
|
||||||
|
// since we have the lock held
|
||||||
this->to_add_.push_back(std::move(item));
|
this->to_add_.push_back(std::move(item));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -354,6 +355,8 @@ void HOT Scheduler::call() {
|
|||||||
|
|
||||||
if (item->type == SchedulerItem::INTERVAL) {
|
if (item->type == SchedulerItem::INTERVAL) {
|
||||||
item->next_execution_ = now + item->interval;
|
item->next_execution_ = now + item->interval;
|
||||||
|
// Add new item directly to to_add_
|
||||||
|
// since we have the lock held
|
||||||
this->to_add_.push_back(std::move(item));
|
this->to_add_.push_back(std::move(item));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user