Skip to content

Commit

Permalink
quick fix
Browse files Browse the repository at this point in the history
  • Loading branch information
NorseGaud committed Dec 6, 2024
1 parent 1bdf680 commit c4ab9d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions plugins/handlers/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit c4ab9d9

Please sign in to comment.