Skip to content

Commit

Permalink
scheduler: actually loop through pending schedules
Browse files Browse the repository at this point in the history
  • Loading branch information
mcspr committed May 22, 2024
1 parent 414705d commit 331c44a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions code/espurna/scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1296,12 +1296,18 @@ void run_delta(Context& ctx) {
}

const auto days = settings::restoreDays();
for (int day = 0; (day < days) && !ctx.pending.empty(); ++day) {
for (int day = 0; day < days; ++day) {
if (!ctx.next()) {
break;
}

handle_delta(ctx, ctx.pending.begin());
for (auto it = ctx.pending.begin(); it != ctx.pending.end();) {
if (handle_delta(ctx, *it)) {
it = ctx.pending.erase(it);
} else {
it = std::next(it);
}
}
}
}

Expand Down

0 comments on commit 331c44a

Please sign in to comment.