Skip to content

Commit a6bb1a0

Browse files
committed
UPD | 1.0.3 release #6
1 parent 19a854d commit a6bb1a0

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/ManapiTimerPool.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ manapi::error::status manapi::timerpool::again_timer(std::shared_ptr<manapi::tim
117117
if (!res.second)
118118
return error::status_internal("timerpool:insert failed");
119119

120-
if (res.first == this->data_->sorted_tasks.begin())
121-
reinit_timer_(this->data_);
122120

123121
if (res.first->second->flags & TIMER_TASK_IMPORTANT) {
124122
this->data_->importants++;
@@ -132,6 +130,9 @@ manapi::error::status manapi::timerpool::again_timer(std::shared_ptr<manapi::tim
132130
}
133131
}
134132

133+
if (res.first == this->data_->sorted_tasks.begin())
134+
reinit_timer_(this->data_);
135+
135136
return error::status_ok();
136137
}
137138
catch (std::bad_alloc const &) {
@@ -215,10 +216,10 @@ void manapi::timerpool::erase_task_(const std::shared_ptr<data_t> &data_,sorted_
215216
}
216217

217218
void manapi::timerpool::start_(const std::shared_ptr<data_t> &data) MANAPIHTTP_NOEXCEPT {
218-
if (data->flags & TIMERPOOL_FLAG_RUNNING) {
219-
/* it is already running */
220-
return;
221-
}
219+
// if (data->flags & TIMERPOOL_FLAG_RUNNING) {
220+
// /* it is already running */
221+
// return;
222+
// }
222223

223224
auto now = std::chrono::steady_clock::now();
224225
data->flags |= TIMERPOOL_FLAG_RUNNING;
@@ -358,7 +359,7 @@ manapi::error::status manapi::timerpool::update_interval_state_(const std::share
358359
data_->importants++;
359360
}
360361

361-
if (data_->sorted_tasks.begin() == res.first) {
362+
if (data_->sorted_tasks.begin()->second == data) {
362363
reinit_timer_(data_);
363364
}
364365

0 commit comments

Comments
 (0)