Skip to content

Commit

Permalink
feat: playbook table sync
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe authored and moshloop committed Nov 6, 2024
1 parent b899e15 commit 4787c8b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -134,13 +136,17 @@ func tableUpdatesHandler(ctx context.Context) {

notificationUpdateCh := notifyRouter.GetOrCreateChannel("notifications")
teamsUpdateChan := notifyRouter.GetOrCreateChannel("teams")
playbooksUpdateChan := notifyRouter.GetOrCreateChannel("playbooks")
permissionUpdateChan := notifyRouter.GetOrCreateChannel("permissions")

for {
select {
case id := <-notificationUpdateCh:
notification.PurgeCache(id)

case id := <-playbooksUpdateChan:
query.InvalidateCacheByID[models.Playbook](id)

case id := <-teamsUpdateChan:
responder.PurgeCache(id)
teams.PurgeCache(id)
Expand Down

0 comments on commit 4787c8b

Please sign in to comment.