瀏覽代碼

embed: sync logger on server close

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
Gyuho Lee 7 年之前
父節點
當前提交
c76c696ed7
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      embed/etcd.go

+ 5 - 0
embed/etcd.go

@@ -312,6 +312,11 @@ func (e *Etcd) Close() {
 			cancel()
 		}
 	}
+
+	lg := e.GetLogger()
+	if lg != nil {
+		lg.Sync()
+	}
 }
 
 func stopServers(ctx context.Context, ss *servers) {