Browse Source
Merge pull request #120 from namejlt/main
Update config.go
pull/125/head
yedf2
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
10 additions and
3 deletions
-
common/config.go
|
|
|
@ -102,10 +102,10 @@ func checkConfig() error { |
|
|
|
if Config.TimeoutToFail < Config.RetryInterval { |
|
|
|
return errors.New("TimeoutToFail should not be less than RetryInterval") |
|
|
|
} |
|
|
|
if Config.Store.Driver == BoltDb { |
|
|
|
switch Config.Store.Driver { |
|
|
|
case BoltDb: |
|
|
|
return nil |
|
|
|
} |
|
|
|
if Config.Store.Driver == Mysql { |
|
|
|
case Mysql: |
|
|
|
if Config.Store.Host == "" { |
|
|
|
return errors.New("Db host not valid ") |
|
|
|
} |
|
|
|
@ -115,6 +115,13 @@ func checkConfig() error { |
|
|
|
if Config.Store.User == "" { |
|
|
|
return errors.New("Db user not valid ") |
|
|
|
} |
|
|
|
case Redis: |
|
|
|
if Config.Store.Host == "" { |
|
|
|
return errors.New("Redis host not valid ") |
|
|
|
} |
|
|
|
if Config.Store.Port == 0 { |
|
|
|
return errors.New("Redis port not valid ") |
|
|
|
} |
|
|
|
} |
|
|
|
return nil |
|
|
|
} |
|
|
|
|