diff --git a/backend/cmd/main.go b/backend/cmd/main.go index 69cab9a..c368cdd 100644 --- a/backend/cmd/main.go +++ b/backend/cmd/main.go @@ -93,7 +93,7 @@ func main() { // Initialize script interpreter repository and service scriptRepo := repository.NewScriptInterpreterRepo(db) if err := scriptRepo.Init(context.Background()); err != nil { - log.Printf("Warning: failed to initialize script interpreters table: %v", err) + log.Fatalf("Warning: failed to initialize script interpreters table: %v\n", err) } scriptSvc := service.NewScriptServiceWithInterpreters(h.Repo, scriptRepo) scriptHandlers := handlers.NewScriptHandlers(scriptSvc, cmdTracker, @@ -103,9 +103,7 @@ func main() { jobRepo, ) - // Initialize script management service and handlers - scriptManageSvc := service.NewScriptService(h.Repo) - scriptManageHandlers := handlers.NewScriptHandlersGroup(scriptManageSvc, cmdr, + scriptManageHandlers := handlers.NewScriptHandlersGroup(scriptSvc, cmdr, os.Getenv("WHEREAMI")) agents := handlers.NewAgentsGroup(h, coll)