Skip to content

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

chore: refresh subscription (#17395)

ecmadaoe6b6237e0e3d
diff --git a/backend/api/v1/actuator_service.go b/backend/api/v1/actuator_service.go
index ca092a696a..b1aa5bf11c 100644
--- a/backend/api/v1/actuator_service.go
+++ b/backend/api/v1/actuator_service.go
@@ -91,10 +91,11 @@ func (s *ActuatorService) UpdateActuatorInfo(
// DeleteCache deletes the cache.
func (s *ActuatorService) DeleteCache(
- _ context.Context,
+ ctx context.Context,
_ *connect.Request[v1pb.DeleteCacheRequest],
) (*connect.Response[emptypb.Empty], error) {
s.store.DeleteCache()
+ s.licenseService.RefreshCache(ctx)
return connect.NewResponse(&emptypb.Empty{}), nil
}
diff --git a/backend/api/v1/sql_service.go b/backend/api/v1/sql_service.go
index 1e3c9f05c0..030d33c9f8 100644
--- a/backend/api/v1/sql_service.go
+++ b/backend/api/v1/sql_service.go
@@ -508,6 +508,7 @@ func queryRetry(
}
if i < len(spans) && spans[i].NotFoundError != nil {
for k := range spans[i].SourceColumns {
+ slog.Debug("database metadata need to sync", slog.String("instance", instance.ResourceID), slog.String("database", k.Database), slog.String("schema", k.Schema), slog.String("table", k.Table), slog.String("column", k.Column))
syncDatabaseMap[k.Database] = true
}
}
diff --git a/backend/enterprise/license.go b/backend/enterprise/license.go
index 104492800f..0fb31e0a19 100644
--- a/backend/enterprise/license.go
+++ b/backend/enterprise/license.go
@@ -176,10 +176,16 @@ func (s *LicenseService) StoreLicense(ctx context.Context, license string) error
return err
}
+ // refresh the cached subscription after storing the license.
+ s.RefreshCache(ctx)
+ return nil
+}
+
+// RefreshCache refresh the cache for subscription.
+func (s *LicenseService) RefreshCache(ctx context.Context) {
// refresh the cached subscription after storing the license.
s.mu.Lock()
s.cachedSubscription = nil
s.mu.Unlock()
s.LoadSubscription(ctx)
- return nil
}