Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: skip anomaly checks for deleted databases (#4503)

Danny Xu63433a82b3bf
diff --git a/backend/runner/anomaly/scanner.go b/backend/runner/anomaly/scanner.go
index a51f1d3f7c..de74e3ef36 100644
--- a/backend/runner/anomaly/scanner.go
+++ b/backend/runner/anomaly/scanner.go
@@ -130,6 +130,10 @@ func (s *Scanner) Run(ctx context.Context, wg *sync.WaitGroup) {
return
}
for _, database := range databases {
+ // Skip deleted databases.
+ if database.SyncState != api.OK {
+ continue
+ }
s.checkDatabaseAnomaly(ctx, instance, database)
s.checkBackupAnomaly(ctx, environment, instance, database, backupPlanPolicyMap)
}
diff --git a/backend/runner/schemasync/syncer.go b/backend/runner/schemasync/syncer.go
index 681f95c369..9ed75da4db 100644
--- a/backend/runner/schemasync/syncer.go
+++ b/backend/runner/schemasync/syncer.go
@@ -126,6 +126,7 @@ func (s *Syncer) syncAllDatabases(ctx context.Context, instance *api.Instance) {
instanceMap := make(map[string][]*store.DatabaseMessage)
for _, database := range databases {
+ // Skip deleted databases.
if database.SyncState != api.OK {
continue
}