diff --git a/main.go b/main.go index 0843b86..4b73ea5 100644 --- a/main.go +++ b/main.go @@ -416,8 +416,9 @@ func worker(parentCtx context.Context, logger *slog.Logger, loadedConfig config. logging.DevContext(pluginCtx, "plugin is not a receiver; loading the anka CLI") ankaCLI, err := anka.NewCLI(pluginCtx) if err != nil { - pluginCancel() logger.ErrorContext(pluginCtx, "unable to create anka cli", "error", err) + pluginCancel() + workerCancel() return } pluginCtx = context.WithValue(pluginCtx, config.ContextKey("ankacli"), ankaCLI) @@ -443,6 +444,7 @@ func worker(parentCtx context.Context, logger *slog.Logger, loadedConfig config. if err != nil { logger.ErrorContext(pluginCtx, "unable to access database", "error", err) pluginCancel() + workerCancel() return } pluginCtx = context.WithValue(pluginCtx, config.ContextKey("database"), databaseClient) diff --git a/plugins/handlers/github/github.go b/plugins/handlers/github/github.go index 2c225e7..b7d88b5 100644 --- a/plugins/handlers/github/github.go +++ b/plugins/handlers/github/github.go @@ -505,8 +505,8 @@ func Run( hostHasVmCapacity := anka.HostHasVmCapacity(pluginCtx) if !hostHasVmCapacity { - // logger.DebugContext(pluginCtx, "host does not have vm capacity") - return pluginCtx, fmt.Errorf("host does not have vm capacity") + logger.WarnContext(pluginCtx, "host does not have vm capacity") + return pluginCtx, nil } var githubClient *github.Client @@ -767,9 +767,9 @@ func Run( if err != nil { // this is thrown, for example, when there is no capacity on the host // we must be sure to create the DB entry so cleanup happens properly - // logger.ErrorContext(pluginCtx, "error obtaining anka vm", "err", err) + logger.ErrorContext(pluginCtx, "error obtaining anka vm", "err", err) failureChannel <- true - return pluginCtx, fmt.Errorf("error obtaining anka vm: %s", err.Error()) + return pluginCtx, nil } if pluginCtx.Err() != nil {