LiteCron is a In-Processing distributed cron job processor. its easy to handle you cron job into you web app. you don't need any special machine for run cron job.
- running cron job into my web app.
- build a distributed cron job service(for replace system cron service).
//Step 1: init default cron client.
litecron.InitDefaultCron(&litecron.MutexConfig{
RedisConfig:&litecron.RedisConfig{
DNS:"127.0.0.1:6379",
},
Prefix:"litecron/examples/defaults/",
Factor:0.01,
})
//Register a cron job for every 2 seconds.
litecron.Register("@every 2s",exampleHandle)
go litecron.Run()
time.Sleep(10 * time.Second)
// Output: