public
Last active

Sample scheduled job

  • Download Gist
scheduledDistribute.scala
Scala
1 2 3 4 5 6 7 8 9
@Value("${deliveryService.distributeSchedule:0,30 * * * * *}")
var distributeSchedule: String = _
 
schedulerService.addJob(
SchedulerJob("distributeEvents", () => scheduledDistribute(), distributeSchedule))
 
def scheduledDistribute() =
if (clusterService.clusterStatus.isLeader)
distribute()

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.