Compare commits
No commits in common. "ca400be8b805fb3ecadfac701d64703f833bd342" and "720322bfd64a5e84f2ad0b4e48fa942b6baf2322" have entirely different histories.
ca400be8b8
...
720322bfd6
|
|
@ -121,10 +121,10 @@ func UserSyncDataFromMaster() {
|
||||||
fmt.Println("All ClearAllUsers error:", err)
|
fmt.Println("All ClearAllUsers error:", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
worker.SetRedisForever("user_sync_all", "1")
|
worker.SetRedis("user_sync_all", "2")
|
||||||
req.Types = 1
|
req.Types = 1
|
||||||
} else {
|
} else {
|
||||||
worker.SetRedisForever("user_sync_all", "2")
|
worker.SetRedis("user_sync_all", "2")
|
||||||
req.Types = 2
|
req.Types = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -184,7 +184,7 @@ func UserSyncDataFromMaster() {
|
||||||
confirm_req.Confirm = data
|
confirm_req.Confirm = data
|
||||||
worker.SyncDataFromMasterReq2(url, confirm_req)
|
worker.SyncDataFromMasterReq2(url, confirm_req)
|
||||||
} else {
|
} else {
|
||||||
worker.SetRedisForever("user_sync_all", "2")
|
worker.SetRedis("user_sync_all", "2")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,17 +71,6 @@ func SetRedis(key string, value string) bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置redis,永久
|
|
||||||
func SetRedisForever(key string, value string) bool {
|
|
||||||
ctx := context.Background()
|
|
||||||
err := RedisClient.Set(ctx, key, value, 0).Err()
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println("Error setting key: %v", err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// 设置hash
|
// 设置hash
|
||||||
func SetHashWithTime(key string, id int, name, email string, duration time.Duration) bool {
|
func SetHashWithTime(key string, id int, name, email string, duration time.Duration) bool {
|
||||||
//捕获错误,如果错误返回
|
//捕获错误,如果错误返回
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue