summaryrefslogtreecommitdiff
path: root/cmd/start.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/start.go')
-rw-r--r--cmd/start.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/cmd/start.go b/cmd/start.go
index fa00786..f6a2267 100644
--- a/cmd/start.go
+++ b/cmd/start.go
@@ -2,8 +2,11 @@ package cmd
import (
"apjournal/config"
+ "apjournal/internal/crons"
+ "apjournal/internal/database/repos"
database "apjournal/internal/database/sql"
"apjournal/internal/server"
+ "context"
"os"
"log/slog"
@@ -34,7 +37,10 @@ var startCmd = &cobra.Command{
log.Error("failed to connect to db", "error", err)
return
}
- srv := server.NewServer(cfg, log, db.Conn)
+ repo := repos.NewProvider(db.Conn)
+ srv := server.NewServer(cfg, log, repo)
+ cron := crons.NewCron(context.Background(), repo)
+ cron.StartCronJobs()
// listen for new messages
srv.Listen()
},