From 2ce79fd66c3ae519076afd13c3ad61db1a8ad0ab Mon Sep 17 00:00:00 2001 From: MohammadReza Palide Date: Tue, 9 Jan 2024 13:25:55 +0000 Subject: [PATCH] change oldApps logic on read config on vpn-monitor | remove unnecessary codes --- cmd/vpn-monitor/commands/root.go | 3 --- pkg/vpn-monitor/api/api.go | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/cmd/vpn-monitor/commands/root.go b/cmd/vpn-monitor/commands/root.go index 8e269fb6..a1f2b20d 100644 --- a/cmd/vpn-monitor/commands/root.go +++ b/cmd/vpn-monitor/commands/root.go @@ -3,7 +3,6 @@ package commands import ( "context" - "fmt" "log" "os" "time" @@ -60,8 +59,6 @@ var RootCmd = &cobra.Command{ mLogger := logging.NewMasterLogger() conf := api.InitConfig(confPath, mLogger) - fmt.Println(conf.Version) - srvURLs := api.ServicesURLs{ SD: conf.Launcher.ServiceDisc, UT: conf.UptimeTracker.Addr, diff --git a/pkg/vpn-monitor/api/api.go b/pkg/vpn-monitor/api/api.go index f2f8ed80..43955bd9 100644 --- a/pkg/vpn-monitor/api/api.go +++ b/pkg/vpn-monitor/api/api.go @@ -390,7 +390,7 @@ func InitConfig(confPath string, mLog *logging.MasterLogger) *visorconfig.V1 { for _, app := range conf.Launcher.Apps { for _, oldApp := range oldConf.Launcher.Apps { if app.Name == oldApp.Name { - newConfLauncherApps = append(newConfLauncherApps, app) + newConfLauncherApps = append(newConfLauncherApps, oldApp) } } }