Merge pull request #1857 from LalitDeore/ui-fix

fix minor UI issue
This commit is contained in:
Frikky
2025-11-12 11:39:33 +01:00
committed by GitHub
2 changed files with 31 additions and 0 deletions
+28
View File
@@ -4956,6 +4956,17 @@ func handleCloudSetup(resp http.ResponseWriter, request *http.Request) {
resp.Write(b)
} else {
// Delete cache for the sync features
cacheKey := fmt.Sprintf("org_sync_features_%s", org.Id)
shuffle.DeleteCache(ctx, cacheKey)
subscriptionCacheKey := fmt.Sprintf("org_subscriptions_%s", org.Id)
shuffle.DeleteCache(ctx, subscriptionCacheKey)
licenseCacheKey := fmt.Sprintf("org_licensed_%s", org.Id)
shuffle.DeleteCache(ctx, licenseCacheKey)
resp.WriteHeader(200)
resp.Write([]byte(fmt.Sprintf(`{"success": true, "reason": "Successfully disabled cloud sync for org."}`)))
}
@@ -5047,6 +5058,23 @@ func handleCloudSetup(resp http.ResponseWriter, request *http.Request) {
shuffle.SetCache(ctx, cacheKey, featuresBytes, 1800)
}
subscriptionCacheKey := fmt.Sprintf("org_subscriptions_%s", org.Id)
subscriptionsBytes, err := json.Marshal(responseData.Subscriptions)
if err != nil {
log.Printf("[ERROR] Failed to marshal Subscriptions for cache: %s", err)
} else {
shuffle.SetCache(ctx, subscriptionCacheKey, subscriptionsBytes, 1800)
}
licenseCacheKey := fmt.Sprintf("org_licensed_%s", org.Id)
licensedBytes, err := json.Marshal(responseData.Licensed)
if err != nil {
log.Printf("[ERROR] Failed to marshal Licensed for cache: %s", err)
} else {
shuffle.SetCache(ctx, licenseCacheKey, licensedBytes, 1800)
}
org.SyncConfig = shuffle.SyncConfig{
Apikey: responseData.SessionKey,
Interval: responseData.IntervalSeconds,