Skip to content

Commit

Permalink
Merge pull request #1327 from pi-hole/fix/overTime
Browse files Browse the repository at this point in the history
Fix overtime computation logic broken in PR #1312
  • Loading branch information
yubiuser authored Apr 8, 2022
2 parents 3ebb7b2 + e460a67 commit e4e397d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/overTime.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ void initOverTime(void)
time_t now = time(NULL);

// Get the centered timestamp of the current timestamp
time_t first_slot_ts = now - now % OVERTIME_INTERVAL + (OVERTIME_INTERVAL / 2);
time_t last_slot_ts = first_slot_ts + (OVERTIME_SLOTS-1) * OVERTIME_INTERVAL;
const time_t last_slot_ts = now - now % OVERTIME_INTERVAL + (OVERTIME_INTERVAL / 2);
const time_t first_slot_ts = last_slot_ts - (OVERTIME_SLOTS-1) * OVERTIME_INTERVAL;

if(config.debug & DEBUG_OVERTIME)
logg("initOverTime(): Initializing %i slots from %llu to %llu",
Expand Down

0 comments on commit e4e397d

Please sign in to comment.