Feat: add cleaner cron
This commit is contained in:
		
							
								
								
									
										8
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								main.go
									
									
									
									
									
								
							| @@ -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 { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Grail Finder
					Grail Finder