|
|
@@ -77,11 +77,11 @@ func SaveLatestList(appCtx *model.AppContext, client *redis.Client, ctx context. |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func SaveSettings(appCtx *model.AppContext, client *redis.Client, ctx context.Context) { |
|
|
func SaveSettings(appCtx *model.AppContext, client *redis.Client, ctx context.Context) { |
|
|
appCtx.LatestList.Lock.Lock() |
|
|
|
|
|
data, _ := json.Marshal(appCtx.LatestList.LatestList) |
|
|
|
|
|
appCtx.LatestList.Lock.Unlock() |
|
|
|
|
|
|
|
|
appCtx.Settings.Lock.Lock() |
|
|
|
|
|
data, _ := json.Marshal(appCtx.Settings.Settings) |
|
|
|
|
|
appCtx.Settings.Lock.Unlock() |
|
|
|
|
|
|
|
|
err := client.Set(ctx, "latestList", data, 0).Err() |
|
|
|
|
|
|
|
|
err := client.Set(ctx, "settings", data, 0).Err() |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
fmt.Println("error in saving to redis: ", err) |
|
|
fmt.Println("error in saving to redis: ", err) |
|
|
} |
|
|
} |
|
|
|