Browse Source

Merge pull request #261 from xyctruth/main

optimize wait store up log
pull/262/head
yedf2 4 years ago
committed by GitHub
parent
commit
be883f4b3a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      dtmsvr/storage/registry/registry.go

3
dtmsvr/storage/registry/registry.go

@ -3,6 +3,8 @@ package registry
import (
"time"
"github.com/dtm-labs/dtm/dtmcli/logger"
"github.com/dtm-labs/dtm/dtmsvr/config"
"github.com/dtm-labs/dtm/dtmsvr/storage"
"github.com/dtm-labs/dtm/dtmsvr/storage/boltdb"
@ -47,6 +49,7 @@ func GetStore() storage.Store {
// WaitStoreUp wait for db to go up
func WaitStoreUp() {
for err := GetStore().Ping(); err != nil; err = GetStore().Ping() {
logger.Infof("wait store up")
time.Sleep(3 * time.Second)
}
}

Loading…
Cancel
Save