diff options
author | GrailFinder <wohilas@gmail.com> | 2024-06-12 09:13:05 +0300 |
---|---|---|
committer | GrailFinder <wohilas@gmail.com> | 2024-06-12 09:13:05 +0300 |
commit | b300ad869f424cdd26bcfc78635a27656836ca96 (patch) | |
tree | fc675c3608269d367be2ec23fd689f030bfaebd2 /cmd/start.go | |
parent | 01f9a9f5d71450a0c80195058245fdebe88796bd (diff) |
Diffstat (limited to 'cmd/start.go')
-rw-r--r-- | cmd/start.go | 8 |
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() }, |