From 0b9d13fb2d15229cf951b8dffd7a8b8f94014adc Mon Sep 17 00:00:00 2001 From: "lalitdeore12@gmail.com" Date: Wed, 1 Oct 2025 16:04:51 +0530 Subject: [PATCH] add cloud sync data in cache --- backend/go-app/main.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/backend/go-app/main.go b/backend/go-app/main.go index b10d441d..475357ee 100755 --- a/backend/go-app/main.go +++ b/backend/go-app/main.go @@ -3818,9 +3818,10 @@ func handleCloudJob(job shuffle.CloudSyncJob) error { // Handles jobs from remote (cloud) func remoteOrgJobController(org shuffle.Org, body []byte) error { type retStruct struct { - Success bool `json:"success"` - Reason string `json:"reason"` - Jobs []shuffle.CloudSyncJob `json:"jobs"` + Success bool `json:"success"` + Reason string `json:"reason"` + Jobs []shuffle.CloudSyncJob `json:"jobs"` + SyncFeatures shuffle.SyncFeatures `json:"sync_features"` } responseData := retStruct{} @@ -3887,6 +3888,14 @@ func remoteOrgJobController(org shuffle.Org, body []byte) error { log.Printf("Got job with reason %s and %d job(s)", responseData.Reason, len(responseData.Jobs)) } + 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, 30) + } + for _, job := range responseData.Jobs { err = handleCloudJob(job) if err != nil {