From 67588bc7393ab714c89b171510e0e97ec9920105 Mon Sep 17 00:00:00 2001 From: Aditya Thebe Date: Tue, 5 Nov 2024 10:30:52 +0545 Subject: [PATCH] feat: playbook table sync --- cmd/server.go | 6 ++++++ go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/cmd/server.go b/cmd/server.go index 1ce77eba..2d4ecc8d 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.GetterCacheDeleteByID[models.Playbook](id) + case id := <-teamsUpdateChan: responder.PurgeCache(id) teams.PurgeCache(id) diff --git a/go.mod b/go.mod index dbea9208..44703d84 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index 4e79d5c7..e31d9632 100644 --- a/go.sum +++ b/go.sum @@ -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=