From 2185d2be7c97161dc8e11e44dcb392a9c95a2438 Mon Sep 17 00:00:00 2001 From: Yann Stepienik Date: Sat, 1 Jul 2023 17:06:12 +0100 Subject: [PATCH] [release] v0.9.0-unstable3 --- package.json | 2 +- src/CRON.go | 15 +++++---------- src/docker/api_blueprint.go | 2 +- src/httpServer.go | 2 +- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index f73724f..1a55697 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cosmos-server", - "version": "0.9.0-unstable2", + "version": "0.9.0-unstable3", "description": "", "main": "test-server.js", "bugs": { diff --git a/src/CRON.go b/src/CRON.go index 64d9c4a..c0ce84d 100644 --- a/src/CRON.go +++ b/src/CRON.go @@ -118,15 +118,10 @@ func checkCerts() { func CRON() { go func() { - gocron.Every(1).Day().At("00:00").Do(checkVersion) - <-gocron.Start() - }() - go func() { - gocron.Every(1).Day().At("01:00").Do(checkCerts) - <-gocron.Start() - }() - go func() { - gocron.Every(6).Hours().Do(checkUpdatesAvailable) - <-gocron.Start() + s := gocron.NewScheduler() + s.Every(1).Day().At("00:00").Do(checkVersion) + s.Every(1).Day().At("01:00").Do(checkCerts) + s.Every(6).Hours().Do(checkUpdatesAvailable) + s.Start() }() } \ No newline at end of file diff --git a/src/docker/api_blueprint.go b/src/docker/api_blueprint.go index a94daeb..37bef51 100644 --- a/src/docker/api_blueprint.go +++ b/src/docker/api_blueprint.go @@ -707,7 +707,7 @@ func CreateService(serviceRequest DockerServiceCreateRequest, OnLog func(string) // Save the route configs config.HTTPConfig.ProxyConfig.Routes = configRoutes utils.SaveConfigTofile(config) - utils.NeedsRestart = true + utils.RestartHTTPServer() // After all operations utils.Log("CreateService: Operation succeeded. SERVICE STARTED") diff --git a/src/httpServer.go b/src/httpServer.go index f2abbb5..ab4293e 100644 --- a/src/httpServer.go +++ b/src/httpServer.go @@ -365,7 +365,7 @@ func InitServer() *mux.Router { router = proxy.BuildFromConfig(router, HTTPConfig.ProxyConfig) router.HandleFunc("/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - http.Redirect(w, r, "/cosmos-ui", http.StatusMovedPermanently) + http.Redirect(w, r, "/cosmos-ui", http.StatusTemporaryRedirect) }))