mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #15842 from qsyqian/main
log time when open backend db took too long
This commit is contained in:
commit
3024d9461d
@ -76,9 +76,12 @@ func OpenBackend(cfg config.ServerConfig, hooks backend.Hooks) backend.Backend {
|
||||
beOpened <- newBackend(cfg, hooks)
|
||||
}()
|
||||
|
||||
defer func() {
|
||||
cfg.Logger.Info("opened backend db", zap.String("path", fn), zap.Duration("took", time.Since(now)))
|
||||
}()
|
||||
|
||||
select {
|
||||
case be := <-beOpened:
|
||||
cfg.Logger.Info("opened backend db", zap.String("path", fn), zap.Duration("took", time.Since(now)))
|
||||
return be
|
||||
|
||||
case <-time.After(10 * time.Second):
|
||||
|
Loading…
x
Reference in New Issue
Block a user