I'm adding a new minutely cron task as follows:
library(cronR)
cron_datamultiple <- cron_rscript("multiple_data.R")
cron_add(command = cron_datamultiple, frequency = 'minutely', id = 'test1', description = 'My process 1', tags = c('test1'), ask=FALSE)
If the task takes more than 1 minute, another task starts so the tasks are gettinmg slower. Finally my Google Cloud virtual machine instance crashes.
How can I write a code for:
- not start the next scheduled task before the running task finishes. OR
- kill the running task if it took more than 1 minute.
Thanks.