degesch: fix the date change timer
It used absolute time, while we need relative.
This commit is contained in:
parent
0ce4872254
commit
5b96f2ccb7
|
@ -9035,9 +9035,10 @@ static void
|
||||||
rearm_date_change_timer (struct app_context *ctx)
|
rearm_date_change_timer (struct app_context *ctx)
|
||||||
{
|
{
|
||||||
const time_t seconds_per_day = 60 * 60 * 12;
|
const time_t seconds_per_day = 60 * 60 * 12;
|
||||||
poller_timer_set (&ctx->date_chg_tmr,
|
const time_t now = time (NULL);
|
||||||
(time (NULL) + seconds_per_day - 1)
|
const time_t midnight = (now + seconds_per_day - 1)
|
||||||
/ seconds_per_day * seconds_per_day * 1000);
|
/ seconds_per_day * seconds_per_day;
|
||||||
|
poller_timer_set (&ctx->date_chg_tmr, (midnight - now) * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue