feat(statuspage): fetch every served page every five minutes
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Canceled after 5m23s
ci / test (pull_request) Canceled after 5m23s
ci / build (pull_request) Canceled after 0s
ci / image (pull_request) Canceled after 0s

A status page server only knew the pages visitors had asked it for, so
during an API outage a server that had never seen a page could not
serve it. The agent API now lists the pages a server serves
(GET /agent/v1/pages/index), following the same rule as single pages,
and status page servers fetch all of them on start and every five
minutes, also dropping those no longer listed. Pages visited within the
last ten minutes are still refreshed every 30 seconds; the outdated
notice now appears after ten minutes, twice the sync interval.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-11-24 22:51:46 +01:00
1 parent c0239e15bb
commit 4e9a198b2f
10 files changed
+217 -15

No files matched your search

+20
View File
@@ -377,6 +377,26 @@ func (s *Server) agentPage(c *gin.Context) {
c.JSON(http.StatusOK, snap)
}
// agentPageIndex lists the pages the status page server serves.
func (s *Server) agentPageIndex(c *gin.Context) {
ctx := c.Request.Context()
var rows []store.ServablePagesRow
err := s.db.Tx(ctx, tenant.System(), func(q *store.Queries) error {
var err error
rows, err = q.ServablePages(ctx, agentOf(c).OrgID)
return err
})
if err != nil {
internalError(c, err)
return
}
out := make([]agentapi.PageRef, len(rows))
for i, r := range rows {
out[i] = agentapi.PageRef{Slug: r.Slug, Host: r.Host}
}
c.JSON(http.StatusOK, gin.H{"pages": out})
}
type statusPageRequest struct {
Slug string `json:"slug" binding:"required,max=63"`
Title string `json:"title" binding:"required,max=200"`