Feat: add cleaner cron

This commit is contained in:
Grail Finder
2025-07-04 10:34:08 +03:00
parent 83215f5c14
commit 71a2d9d747
8 changed files with 116 additions and 5 deletions

View File

@ -3,7 +3,9 @@ package main
import (
"context"
"gralias/config"
"gralias/crons"
"gralias/handlers"
"gralias/repos"
"log/slog"
"net/http"
"os"
@ -61,6 +63,12 @@ func main() {
stop := make(chan os.Signal, 1)
signal.Notify(stop, os.Interrupt, syscall.SIGTERM)
repo := repos.NewRepoProvider(cfg.DBPath)
defer repo.Close()
cm := crons.NewCronManager(repo, slog.Default())
cm.Start()
server := ListenToRequests(cfg.ServerConfig.Port)
go func() {
if err := server.ListenAndServe(); err != nil && err != http.ErrServerClosed {