Hi there.
I need nestjs app to be started every minute at hh:mm:00 or couple seconds later. Since there is 5+ seconds required to run container and nestjs app I configured the job to run at hh:mm:55
job "scheduler-publisher" {
datacenters = ["us-east-1"]
region = "global"
type = "batch"
periodic {
cron = "55 * * * * * *"
prohibit_overlap = true
}
group "scheduler-publisher" {
...
}
}
My expectation was that the allocation will receive the task at around hh:mm:55 but on some reason it always (every minute) gets the task at ~hh:mm:40.
Another weird thing that the time allocation receives a task is not stable. Initially it was around hh:mm:55. On the next day ~50% of allocations for the periodic job received a task at hh:mm:48 and 50% still at hh:mm:55. Today all allocations receive a task at hh:mm:40.
Not sure that’s expected behaviour. If you know or have any thoughts on why it works like that please share.
Thanks!