fix(api): show legal document changes on every replica immediately
The footer cache expired after 30 seconds, so other replicas showed old links for that long. A version counter in Redis, bumped after each change, now tells every replica to reload with its next request. Refs #67 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
73eb0f8bcd
commit
fad5873879
4 files changed
+96
-33
No files matched your search
@@ -11,6 +11,7 @@ import (
|
||||
"github.com/go-playground/validator/v10"
|
||||
"github.com/redis/go-redis/v9"
|
||||
|
||||
"git.zb-server.de/ZB-Server/uptimesebi/internal/agentapi"
|
||||
"git.zb-server.de/ZB-Server/uptimesebi/internal/auth"
|
||||
"git.zb-server.de/ZB-Server/uptimesebi/internal/authz"
|
||||
"git.zb-server.de/ZB-Server/uptimesebi/internal/config"
|
||||
@@ -42,7 +43,7 @@ type Server struct {
|
||||
sched *schedule.Scheduler
|
||||
eval *evaluate.Evaluator
|
||||
smtp *notify.SMTP
|
||||
legal platformLegal
|
||||
legal *versioned[[]agentapi.LegalDoc]
|
||||
}
|
||||
|
||||
// Deps are the external resources a Server needs.
|
||||
@@ -73,6 +74,7 @@ func New(cfg config.API, d Deps) *Server {
|
||||
totp: auth.NewTOTPVerifier(d.Redis),
|
||||
sso: sso.New(sso.SafeHTTPClient(allowPrivate), cfg.PublicURL+"/sso/callback", allowPrivate),
|
||||
sched: schedule.New(d.Redis),
|
||||
legal: newVersioned[[]agentapi.LegalDoc]("legal"),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user