From b300ad869f424cdd26bcfc78635a27656836ca96 Mon Sep 17 00:00:00 2001 From: GrailFinder Date: Wed, 12 Jun 2024 09:13:05 +0300 Subject: Feat: add cron and defaults table --- internal/server/main.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'internal/server/main.go') diff --git a/internal/server/main.go b/internal/server/main.go index 95d0369..1ab6cc2 100644 --- a/internal/server/main.go +++ b/internal/server/main.go @@ -2,6 +2,7 @@ package server import ( "apjournal/config" + "apjournal/internal/database/repos" "apjournal/internal/handlers" "context" @@ -9,8 +10,6 @@ import ( "os" "os/signal" "syscall" - - "github.com/jmoiron/sqlx" ) // Server interface @@ -41,9 +40,9 @@ func (srv *server) stopOnSignal(close context.CancelFunc) { os.Exit(0) } -func NewServer(cfg config.Config, log *slog.Logger, conn *sqlx.DB) Server { +func NewServer(cfg config.Config, log *slog.Logger, repo repos.FullRepo) Server { ctx, close := context.WithCancel(context.Background()) - actions := handlers.NewHandlers(cfg, log, conn) + actions := handlers.NewHandlers(cfg, log, repo) return &server{ config: cfg, actions: actions, -- cgit v1.2.3