Skip to content

Commit

Permalink
fixed the sleep_interval being ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
NorseGaud committed Oct 22, 2024
1 parent 8c8a7e8 commit 91fdc80
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.8.0
0.8.1
25 changes: 13 additions & 12 deletions internal/run/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 91fdc80

Please sign in to comment.