feat: fire scheduled workflow runs from the housekeeping leader

This commit is contained in:
2026-08-04 13:53:42 +01:00
parent d0e1cc4ad6
commit a1e6986a64
3 changed files with 213 additions and 0 deletions
+11
View File
@@ -11,6 +11,12 @@ import (
"syscall"
"time"
// Embeds the IANA zone database in the binary. Load-bearing: server/Dockerfile
// builds on Alpine, which ships no zoneinfo, so without this
// time.LoadLocation("Europe/London") fails in production and every workflow
// schedule silently falls back to UTC.
_ "time/tzdata"
"gitea.hostxtra.co.uk/mrhid6/vantage/server/internal/api"
"gitea.hostxtra.co.uk/mrhid6/vantage/server/internal/auth"
"gitea.hostxtra.co.uk/mrhid6/vantage/server/internal/bus"
@@ -18,6 +24,7 @@ import (
grpcserver "gitea.hostxtra.co.uk/mrhid6/vantage/server/internal/grpc"
"gitea.hostxtra.co.uk/mrhid6/vantage/server/internal/monitorsched"
"gitea.hostxtra.co.uk/mrhid6/vantage/server/internal/services"
"gitea.hostxtra.co.uk/mrhid6/vantage/server/internal/workflowsched"
"github.com/gin-gonic/gin"
)
@@ -179,6 +186,10 @@ func serve() {
services.StartAuditSweeper(jobCtx)
services.StartReaper(jobCtx)
monitorsched.Start(jobCtx)
workflowsched.Start(jobCtx, workflowsched.Deps{
TriggerWorkflow: services.TriggerWorkflow,
LogEvent: services.LogEvent,
})
ticker := time.NewTicker(2 * time.Minute)
defer ticker.Stop()