CI / test (push) Failing after 6m57s
Setup asks for webhooks, but one left empty was never mentioned again: a lost node or a judge down was told nobody. With no notify.webhooks in the cluster's settings, ctl status and the console's Overview say so, and how to set one. BACKLOG: the judge's refusal after a placement change, tried again on idle VMs, did not happen; a cold judge's first answer is 2-3x slower but inside its budget. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
24 lines
786 B
Go
24 lines
786 B
Go
package adminapi
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"gitea.mynodes.xyz/ilker/llmgw/internal/notify"
|
|
)
|
|
|
|
// SetWebhooks has the summary say when the settings name no webhook:
|
|
// count is how many they name now.
|
|
func (a *API) SetWebhooks(count func() int) { a.webhooks = count }
|
|
|
|
// SetNotifier gives the API the webhooks `ctl notify test` reaches.
|
|
func (a *API) SetNotifier(n *notify.Notifier) { a.notifier = n }
|
|
|
|
// notifyTest sends a test event to every webhook and says how each answered.
|
|
func (a *API) notifyTest(w http.ResponseWriter, r *http.Request) {
|
|
if a.notifier == nil {
|
|
writeError(w, http.StatusNotFound, "no webhooks: the cluster's settings have no notify.webhooks (llmgw ctl config set notify.webhooks ...)")
|
|
return
|
|
}
|
|
writeJSON(w, http.StatusOK, a.notifier.Test(r.Context()))
|
|
}
|