diff --git a/VERSION b/VERSION index 8adc70f..c18d72b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.8.0 \ No newline at end of file +0.8.1 \ No newline at end of file diff --git a/internal/run/run.go b/internal/run/run.go index f5bd48c..ab224fd 100644 --- a/internal/run/run.go +++ b/internal/run/run.go @@ -26,22 +26,23 @@ func Plugin( panic("plugin is not set in yaml:plugins:" + ctxPlugin.Name + ":plugin") } if ctxPlugin.Plugin == "github" { - for { + // for { + select { + case <-pluginCtx.Done(): + pluginCancel() + return + default: + // notify the main thread that the service has started select { - case <-pluginCtx.Done(): - pluginCancel() - return + case <-firstPluginStarted: default: - // notify the main thread that the service has started - select { - case <-firstPluginStarted: - default: - close(firstPluginStarted) - } - github.Run(workerCtx, pluginCtx, pluginCancel, logger, metricsData) - metricsData.SetStatus(pluginCtx, logger, "idle") + close(firstPluginStarted) } + github.Run(workerCtx, pluginCtx, pluginCancel, logger, metricsData) + // metricsData.SetStatus(pluginCtx, logger, "idle") + return // pass back to the main thread/loop } + // } } else if ctxPlugin.Plugin == "github_receiver" { github_receiver.Run(workerCtx, pluginCtx, pluginCancel, logger, firstPluginStarted, metricsData) } else { diff --git a/main.go b/main.go index 0557b2a..9b5f47e 100644 --- a/main.go +++ b/main.go @@ -426,6 +426,7 @@ func worker(parentCtx context.Context, logger *slog.Logger, loadedConfig config. metricsData.SetStatus(pluginCtx, logger, "idle") select { case <-time.After(time.Duration(plugin.SleepInterval) * time.Second): + fmt.Println("======================================") case <-pluginCtx.Done(): logging.DevDebug(pluginCtx, "plugin for loop::default::pluginCtx.Done()") break