Warning: session_start(): open(/var/lib/php/sessions/sess_sop5avf2huva5q8pmsj625u990, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
// returns (timer, estimated firing time) or null
static Pair nextFiringTimerInVM() {
Collection timers = allTimersInVM();
long time = now();
new Lowest best;
for (O timer : timers) pcall {
for (O entry : unnull((Collection) getOpt(timer, 'entries))) {
Long firstTime = cast getOpt(entry, 'firstTime);
Long period = cast getOpt(entry, 'period);
if (firstTime != null && period != null)
if (time >= firstTime)
best.put(timer, period-((time - firstTime) % period));
}
}
ret best.has() ? pair(best!, toLong(time+best.bestScore())) : null;
}