Pool clean by lifecycle config

This commit is contained in:
2024-08-18 14:50:12 +08:00
parent a82fb3a49c
commit 922a76ee7f
3 changed files with 49 additions and 12 deletions

View File

@@ -59,6 +59,7 @@ func main() {
// Configure timed tasks
quartz := cron.New(cron.WithLogger(cron.VerbosePrintfLogger(&log.Logger)))
quartz.AddFunc("@every 60m", services.DoAutoDatabaseCleanup)
quartz.AddFunc("@midnight", services.RunScheduleDeletionTask)
quartz.Start()
// Server
@@ -73,6 +74,7 @@ func main() {
log.Info().Msgf("Paperclip v%s is started...", pkg.AppVersion)
services.ScanUnanalyzedFileFromDatabase()
services.RunScheduleDeletionTask()
quit := make(chan os.Signal, 1)
signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM)