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:
@@ -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...")
|
||||
|
||||
Reference in New Issue
Block a user