Conf Oclib Package Lightest
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"oc-schedulerd/conf"
|
||||
"os/exec"
|
||||
|
||||
oclib "cloud.o-forge.io/core/oc-lib"
|
||||
"github.com/rs/zerolog"
|
||||
)
|
||||
|
||||
@@ -12,20 +13,19 @@ type LocalMonitor struct {
|
||||
ExecutionID string
|
||||
PeerID string
|
||||
Duration int
|
||||
LokiUrl string
|
||||
MongoUrl string
|
||||
DBName string
|
||||
|
||||
LokiUrl string
|
||||
MongoUrl string
|
||||
DBName string
|
||||
}
|
||||
|
||||
func NewLocalMonitor(UUID string, peerId string, duration int) (Executor){
|
||||
func NewLocalMonitor(UUID string, peerId string, duration int) Executor {
|
||||
return &LocalMonitor{
|
||||
ExecutionID: UUID,
|
||||
PeerID: peerId,
|
||||
Duration: duration,
|
||||
LokiUrl: conf.GetConfig().LokiUrl,
|
||||
MongoUrl: conf.GetConfig().MongoUrl,
|
||||
DBName: conf.GetConfig().DBName,
|
||||
PeerID: peerId,
|
||||
Duration: duration,
|
||||
LokiUrl: oclib.GetConfig().LokiUrl,
|
||||
MongoUrl: oclib.GetConfig().MongoUrl,
|
||||
DBName: oclib.GetConfig().MongoDatabase,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,6 @@ func (lm *LocalMonitor) PrepareMonitorExec() []string {
|
||||
"-d", lm.DBName,
|
||||
}
|
||||
|
||||
|
||||
if lm.Duration > 0 {
|
||||
args = append(args, "-t", fmt.Sprintf("%d", lm.Duration))
|
||||
}
|
||||
@@ -54,7 +53,7 @@ func (lm *LocalMonitor) PrepareMonitorExec() []string {
|
||||
return args
|
||||
}
|
||||
|
||||
func (lm *LocalMonitor) LaunchMonitor(args []string, l zerolog.Logger) {
|
||||
func (lm *LocalMonitor) LaunchMonitor(args []string, l zerolog.Logger) {
|
||||
cmd := exec.Command(conf.GetConfig().MonitorPath, args...)
|
||||
fmt.Printf("Command : %v\n", cmd)
|
||||
|
||||
@@ -70,4 +69,3 @@ func (lm *LocalMonitor) LaunchMonitor(args []string, l zerolog.Logger) {
|
||||
|
||||
logExecution(stdoutMonitord, l)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user