Explorar o código

embed: sync logger on server close

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
Gyuho Lee %!s(int64=7) %!d(string=hai) anos
pai
achega
c76c696ed7
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  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) {