From 94533e4aeab2bbb6ea17d50b4b7ca9179ee34396 Mon Sep 17 00:00:00 2001 From: DavidBrayford Date: Tue, 9 Jul 2024 18:20:59 +0200 Subject: [PATCH] Update main.go remove unnecessary optimizer calls --- cmd/cc-energy-manager/main.go | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/cmd/cc-energy-manager/main.go b/cmd/cc-energy-manager/main.go index 3e0b2e6..e16aeb4 100644 --- a/cmd/cc-energy-manager/main.go +++ b/cmd/cc-energy-manager/main.go @@ -39,8 +39,6 @@ import ( "sync" "time" - // DB added - opt "github.com/ClusterCockpit/cc-energy-manager/pkg/Optimizer" cclog "github.com/ClusterCockpit/cc-metric-collector/pkg/ccLogger" lp "github.com/ClusterCockpit/cc-metric-collector/pkg/ccMetric" ) @@ -73,8 +71,6 @@ type RuntimeConfig struct { ReceiveManager receivers.ReceiveManager // Router router.MetricRouter ClustManager cmanager.ClusterManager - //DB - Optimizer opt.Optimizer Channels []chan lp.CCMetric Sync sync.WaitGroup @@ -147,10 +143,6 @@ func shutdownHandler(config *RuntimeConfig, shutdownSignal chan os.Signal) { cclog.Debug("Shutdown ClusterManager...") config.ClustManager.Close() } - if config.Optimizer != nil { - cclog.Debug("Shutdown Optimizer....") - config.Optimizer.Close() - } } func mainFunc() int { @@ -161,8 +153,6 @@ func mainFunc() int { SinkManager: nil, ReceiveManager: nil, // Router: nil, - // DB added an Optimer to rcfg - Optimizer: nil, ClustManager: nil, CliArgs: ReadCli(), } @@ -241,18 +231,11 @@ func mainFunc() int { rcfg.ReceiveManager.AddOutput(ReceiversToRouterChannel) rcfg.ClustManager.AddInput(ReceiversToRouterChannel) - // Optimizer - rcfg.Optimizer.AddInput(RouterToOptimizerChannel) - rcfg.Optimizer.AddOutput(OptimizerToSinksChannel) - // Start the managers rcfg.SinkManager.Start() rcfg.ReceiveManager.Start() rcfg.ClustManager.Start() - // Start the Optimizer - rcfg.Optimizer.Start() - // Wait until one tick has passed. This is a workaround if rcfg.CliArgs["once"] == "true" { x := 1.2 * float64(rcfg.Interval.Seconds())