package scheduler import ( "database/sql" "log" "time" "git.simponic.xyz/simponic/phoneassistant/args" "github.com/go-co-op/gocron/v2" ) func StartScheduler(_dbConn *sql.DB, argv *args.Arguments) { scheduler, err := gocron.NewScheduler() if err != nil { panic("could not create scheduler") } _, err = scheduler.NewJob( gocron.DurationJob( 24*time.Hour, ), gocron.NewTask( func(msg string) { log.Println(msg) }, "it's a beautiful new day!", ), ) if err != nil { panic("could not create job") } scheduler.Start() }