Skip to content

Commit

Permalink
after updating go toolchain through webhook call, also schedule lowpr…
Browse files Browse the repository at this point in the history
…io builds for repo's that opted in
  • Loading branch information
mjl- committed Nov 22, 2024
1 parent e3f2d9b commit 48c2062
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions webhook.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"context"
"log/slog"
"net/http"
"time"
Expand Down Expand Up @@ -35,6 +36,9 @@ func webhookGoToolchainHandler(w http.ResponseWriter, r *http.Request) {
// Horrible hack, we're passing "updated" as "error" when the toolchains have been
// updated. todo: change ipc mechanism to properly pass data.
if err != nil && err.Error() == "updated" {
if err := scheduleLowPrioBuilds(context.Background(), true); err != nil {
slog.Error("scheduling low prio builds after updated toolchains", "err", err)
}
return
}
if err != nil {
Expand All @@ -49,6 +53,8 @@ func webhookGoToolchainHandler(w http.ResponseWriter, r *http.Request) {
slog.Error("error attempting again to update go toolchain", "err", err)
} else if err == nil {
slog.Info("go toolchains not updated in second attempt, giving up for now")
} else if err := scheduleLowPrioBuilds(context.Background(), true); err != nil {
slog.Error("scheduling low prio builds after updated toolchains", "err", err)
}
}()

Expand Down

0 comments on commit 48c2062

Please sign in to comment.