Fix issue-1689

This commit is contained in:
Sowmya Ramapatruni 2021-08-02 13:52:43 -07:00
parent d343dbbd76
commit 58fae22708
2 changed files with 3 additions and 2 deletions

View file

@ -152,7 +152,7 @@ void PQ_TimerMgr::Expire()
int PQ_TimerMgr::DoAdvance(double new_t, int max_expire)
{
Timer* timer = Top();
for ( num_expired = 0; (num_expired < max_expire || max_expire == 0) &&
for ( num_expired = 0; (num_expired < max_expire ) &&
timer && timer->Time() <= new_t; ++num_expired )
{
last_timestamp = timer->Time();

View file

@ -885,9 +885,10 @@ double calc_next_rotate(double current, double interval, double base)
double startofday = mktime(&t);
// current < startofday + base + i * interval <= current + interval
return startofday + base +
double delta_t = startofday + base +
ceil((current - startofday - base) / interval) * interval -
current;
return delta_t > 0.0 ? delta_t: interval;
}
void terminate_processing()