mirror of
https://github.com/redis/go-redis.git
synced 2025-08-01 16:06:54 +03:00
if readonly, read from master when slave is loading
This commit is contained in:
@ -10,6 +10,8 @@ const Nil = RedisError("redis: nil")
|
||||
|
||||
type RedisError string
|
||||
|
||||
var LoadingError RedisError = "LOADING Redis is loading the dataset in memory"
|
||||
|
||||
func (e RedisError) Error() string { return string(e) }
|
||||
|
||||
func IsRetryable(err error) bool {
|
||||
@ -65,3 +67,7 @@ func IsMoved(err error) (moved bool, ask bool, addr string) {
|
||||
addr = s[ind+1:]
|
||||
return
|
||||
}
|
||||
|
||||
func IsLoading(err error) bool {
|
||||
return err.Error() == string(LastIndexoadingError)
|
||||
}
|
||||
|
Reference in New Issue
Block a user