perf(statuspages): build page snapshots in time for large organizations
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Successful in 6m29s
ci / test (pull_request) Successful in 12m37s
ci / build (pull_request) Successful in 18m14s
ci / image (pull_request) Successful in 5m39s
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Successful in 6m29s
ci / test (pull_request) Successful in 12m37s
ci / build (pull_request) Successful in 18m14s
ci / image (pull_request) Successful in 5m39s
The snapshot read the incidents of a page without the organization, which row level security keeps from using an index, and every status page server asking for a page built it on its own. Snapshots now filter by the organization and servers asking at the same time share one build, which does not end when one of them gives up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
1 parent
1138d555aa
commit
27338f0557
5 files changed
+35
-6
No files matched your search
@@ -10,6 +10,7 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/go-playground/validator/v10"
|
||||
"github.com/redis/go-redis/v9"
|
||||
"golang.org/x/sync/singleflight"
|
||||
|
||||
"git.zb-server.de/ZB-Server/uptimesebi/internal/agentapi"
|
||||
"git.zb-server.de/ZB-Server/uptimesebi/internal/auth"
|
||||
@@ -57,6 +58,9 @@ type Server struct {
|
||||
support *versioned[supportSettings]
|
||||
// draining, once closed, ends the long polls of checkers.
|
||||
draining <-chan struct{}
|
||||
// snapshots lets status page servers asking for the same page at once
|
||||
// share one build of it.
|
||||
snapshots singleflight.Group
|
||||
}
|
||||
|
||||
// Deps are the external resources a Server needs.
|
||||
|
||||
Reference in new issue
Block a user