Fixes certain periodicity calculations and adjust to localtime

Additional fix for #3512
This commit is contained in:
Simone Mainardi 2020-03-05 13:03:37 +01:00
parent 8d8cf6678e
commit f3a8efdf73
2 changed files with 11 additions and 8 deletions

View file

@ -518,9 +518,7 @@ void ThreadedActivity::periodicActivityBody() {
if(now >= next_schedule) {
next_deadline = next_schedule + max_duration_secs;
next_schedule = Utils::roundTime(now,
periodicity,
align_to_localtime ? ntop->get_time_offset() : 0);
next_schedule = next_schedule + periodicity - (now - next_schedule) /* re-align in case now is greater than next_schedule */;
if(!skipExecution(path))
schedulePeriodicActivity(pool, now, next_deadline);