From e9814e070b55a4ea9ed2c077dac4fdea7c7045d8 Mon Sep 17 00:00:00 2001 From: Minh Nguyen Date: Fri, 25 Mar 2022 15:27:24 +0700 Subject: [PATCH] rerun --- sync_to_service.go | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/sync_to_service.go b/sync_to_service.go index cf3389e..5566d2a 100644 --- a/sync_to_service.go +++ b/sync_to_service.go @@ -1,7 +1,6 @@ package appier import ( - "context" "fmt" "github.com/Selly-Modules/redisdb" @@ -34,25 +33,30 @@ func (s SyncToService) syncData() { // handleSyncDataToServiceAppier ... func handleSyncDataToServiceAppier(pattern string, typeData string) { - fmt.Println("keyProductPattern", pattern) - for { keys, values := redisdb.GetWithPrefixPattern(pattern) if len(keys) == 0 { + fmt.Println("No keys data") + return + } + + if len(values) == 0 { + fmt.Println("No values DATA") return } processSyncToServiceAppier(typeData, values) - // Del keys - for _, key := range keys { - redisdb.DelKey(context.Background(), key) - } + //// Del keys + //for _, key := range keys { + // redisdb.DelKey(context.Background(), key) + //} } } // processSyncToServiceAppier ... func processSyncToServiceAppier(typeData string, values []string) { + fmt.Println("Sends") for { if len(values) <= 20 { syncDataByList(typeData, values) -- 2.34.1