2
0
mirror of https://github.com/tenrok/event-scheduling.git synced 2026-05-15 11:59:41 +03:00

feat: schedule cron jobs

This commit is contained in:
Dipesh Dulal
2021-01-23 19:23:04 +05:45
parent ed1896b4d7
commit f775c0cef9
+5
View File
@@ -32,11 +32,16 @@ func main() {
scheduler := NewScheduler(db, eventListeners)
stopCron := scheduler.StartCron()
defer stopCron()
scheduler.CheckEventsInInterval(ctx, time.Minute)
scheduler.Schedule("SendEmail", "mail: nilkantha.dipesh@gmail.com", time.Now().Add(1*time.Minute))
scheduler.Schedule("PayBills", "paybills: $4,000 bill", time.Now().Add(2*time.Minute))
scheduler.ScheduleCron("SendEmail", "mail: dipesh.dulal+new@wesionary.team", "* * * * *")
go func() {
for range interrupt {
log.Println("\n❌ Interrupt received closing...")