Skip to content

Commit

Permalink
feat: playbook table sync
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Nov 5, 2024
1 parent 4cd2617 commit 67588bc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 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.GetterCacheDeleteByID[models.Playbook](id)

Check failure on line 148 in cmd/server.go

View workflow job for this annotation

GitHub Actions / lint

undefined: query.GetterCacheDeleteByID (typecheck)

Check failure on line 148 in cmd/server.go

View workflow job for this annotation

GitHub Actions / lint

undefined: query.GetterCacheDeleteByID) (typecheck)

case id := <-teamsUpdateChan:
responder.PurgeCache(id)
teams.PurgeCache(id)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/containrrr/shoutrrr v0.8.0
github.com/fergusstrange/embedded-postgres v1.25.0 // indirect
github.com/flanksource/commons v1.31.2
github.com/flanksource/duty v1.0.742
github.com/flanksource/duty v1.0.743
github.com/flanksource/gomplate/v3 v3.24.39
github.com/flanksource/kopper v1.0.10
github.com/gomarkdown/markdown v0.0.0-20240419095408-642f0ee99ae2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -924,8 +924,8 @@ github.com/flanksource/artifacts v1.0.14 h1:Vv70bccsae0MwGaf/uSPp34J5V1/PyKfct9z
github.com/flanksource/artifacts v1.0.14/go.mod h1:qHVCnQu5k50aWNJ5UhpcAKEl7pAzqUrFFKGSm147G70=
github.com/flanksource/commons v1.31.2 h1:VBhmhmvk6PjhJYuaK8LL+7700E3zPCY03VV/K1BxH64=
github.com/flanksource/commons v1.31.2/go.mod h1:X2txnbNGY6fKQuKLmc7x92FMYjB2MuaqNJOR6vEWDMs=
github.com/flanksource/duty v1.0.742 h1:8zyMn8S0rlyVWTB7uEXCKIzaTW/8WCmj1Fi/I/RoDKU=
github.com/flanksource/duty v1.0.742/go.mod h1:sZY2NytdenrkqXoMD6Gn2C8xH6dm5HsqOeE0p74Z2VE=
github.com/flanksource/duty v1.0.743 h1:ScM0RHUqRLU+ej+Leu0+09N167TPY0ggIngsrxXjCCE=
github.com/flanksource/duty v1.0.743/go.mod h1:sZY2NytdenrkqXoMD6Gn2C8xH6dm5HsqOeE0p74Z2VE=
github.com/flanksource/gomplate/v3 v3.20.4/go.mod h1:27BNWhzzSjDed1z8YShO6W+z6G9oZXuxfNFGd/iGSdc=
github.com/flanksource/gomplate/v3 v3.24.39 h1:O763lnNIcTELSMYeIO0dNDfcb3LoZvzU1fr62I4Yxqg=
github.com/flanksource/gomplate/v3 v3.24.39/go.mod h1:0wY/+UPvd7CxmiTBNmzZdWIEOUZAsRkpGY1j5R711O8=
Expand Down

0 comments on commit 67588bc

Please sign in to comment.