diff --git a/cmd/server.go b/cmd/server.go index 1ce77eba..cb210f49 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -10,7 +10,9 @@ import ( "go.opentelemetry.io/otel" "github.com/flanksource/duty/context" + "github.com/flanksource/duty/models" "github.com/flanksource/duty/postq/pg" + "github.com/flanksource/duty/query" "github.com/flanksource/duty/shutdown" "github.com/flanksource/kopper" @@ -134,6 +136,7 @@ func tableUpdatesHandler(ctx context.Context) { notificationUpdateCh := notifyRouter.GetOrCreateChannel("notifications") teamsUpdateChan := notifyRouter.GetOrCreateChannel("teams") + playbooksUpdateChan := notifyRouter.GetOrCreateChannel("playbooks") permissionUpdateChan := notifyRouter.GetOrCreateChannel("permissions") for { @@ -141,6 +144,9 @@ func tableUpdatesHandler(ctx context.Context) { case id := <-notificationUpdateCh: notification.PurgeCache(id) + case id := <-playbooksUpdateChan: + query.InvalidateCacheByID[models.Playbook](id) + case id := <-teamsUpdateChan: responder.PurgeCache(id) teams.PurgeCache(id)