Fix cloud sync issue when setup first time

This commit is contained in:
lalitdeore12@gmail.com
2025-10-03 16:52:25 +05:30
parent c13137ce8c
commit c3ae26b429
+9 -1
View File
@@ -4940,7 +4940,15 @@ func handleCloudSetup(resp http.ResponseWriter, request *http.Request) {
// 2. Add iterative sync schedule for interval seconds
// 3. Add another environment for the org's users
org.CloudSync = true
org.SyncFeatures = responseData.SyncFeatures
// set cache here for 30 min
cacheKey := fmt.Sprintf("org_sync_features_%s", org.Id)
featuresBytes, err := json.Marshal(responseData.SyncFeatures)
if err != nil {
log.Printf("[ERROR] Failed to marshal SyncFeatures for cache: %s", err)
} else {
shuffle.SetCache(ctx, cacheKey, featuresBytes, 1800)
}
org.SyncConfig = shuffle.SyncConfig{
Apikey: responseData.SessionKey,