In the past, if I needed to call some clean up code every hour, I created a command line tool and called it via a CronJob.
Unfortunately there is no global agreement on how to deploy a CronJob (maybe Kubernetes will change this in the long run)… so I would like to avoid the CronJob, if possible.
With Go I could easily write a goroutine which does something every hour. This way I don’t need to configure a CronJob.
What do you think: do you write less CronJobs with Go, or do you still use CronJobs because of … I would be interested why you still use CronJobs.
There is a recent discussion on Reddit about task schedulers. The bandwidth is high, from goroutines to workflow orchestration engines. In the end, it depends on the particular use case.
it’s intersting.
the point is CronJob not resident in memory, but go-cron resident in memory.
if there is a process guard in system, go-cron may be a nice idea.
My idea to use a goroutine instead of a cronJob to get easier deployment does not scale. If the code gets executed in 100 containers, then the cronjob will run 100 times. I most cases this is not what you want.