must have `redisHost` (#1814)

Signed-off-by: seeflood <349895584@qq.com>
This commit is contained in:
seeflood 2022-06-24 08:06:20 +08:00 committed by GitHub
parent cfdba5ee1d
commit 8f04d5d15d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -63,6 +63,10 @@ func (r *StandaloneRedisLock) InitLockStore(metadata lock.Metadata) error {
return err
}
r.metadata = m
// must have `redisHost`
if metadata.Properties["redisHost"] == "" {
return fmt.Errorf("[standaloneRedisLock]: InitLockStore error. redisHost is empty")
}
// no failover
if needFailover(metadata.Properties) {
return fmt.Errorf("[standaloneRedisLock]: InitLockStore error. Failover is not supported")