Browse Source

Merge pull request #120 from namejlt/main

Update config.go
pull/125/head
yedf2 4 years ago
committed by GitHub
parent
commit
3415bf5d7e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      common/config.go

13
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
}

Loading…
Cancel
Save