diff --git a/main.go b/main.go index cee2957..2ec53b0 100644 --- a/main.go +++ b/main.go @@ -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...")