Allow configuration file to be passed as parameter

This commit is contained in:
TwinProduction
2019-12-04 16:44:35 -05:00
parent 66e48609b4
commit c9c076a959
3 changed files with 51 additions and 18 deletions

View File

@ -18,8 +18,8 @@ func GetServiceResults() *map[string][]*core.Result {
return &serviceResults
}
func Monitor() {
for _, service := range config.Get().Services {
func Monitor(cfg *config.Config) {
for _, service := range cfg.Services {
go func(service *core.Service) {
for {
log.Printf("[watchdog][Monitor] Monitoring serviceName=%s", service.Name)