forked from upstream-mirrors/OpenTracks
For periodic task, set the next time based on current total time
rather than track start time. The current total time would take into account pause/resume time.
This commit is contained in:
@@ -72,11 +72,7 @@ public class TimerTaskExecutor {
|
||||
return;
|
||||
}
|
||||
|
||||
long now = System.currentTimeMillis();
|
||||
long next = tripStatistics.getStartTime();
|
||||
if (next < now) {
|
||||
next = now + interval - ((now - next) % interval);
|
||||
}
|
||||
long next = System.currentTimeMillis() + interval - (tripStatistics.getTotalTime() % interval);
|
||||
timer.scheduleAtFixedRate(new PeriodicTimerTask(), new Date(next), interval);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user