Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ public class BackgroundTaskService {

long current_systime = System.currentTimeMillis();

int maxDelay = 5000
int delay = Math.abs(new Random().nextInt() % maxDelay) + 1
log.debug("Delaying ${delay} milliseconds prior to running background tasks");
sleep(delay);

log.debug("Checking timers");
Timer[] timers = Timer.executeQuery('select t from Timer as t where ( ( t.nextExecution is null ) OR ( t.nextExecution < :now ) ) and t.enabled=:en',
[now:current_systime, en: true]);
Expand Down
Loading