Browse Source

embed: sync logger on server close

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
Gyuho Lee 7 years ago
parent
commit
c76c696ed7
1 changed files with 5 additions and 0 deletions
  1. 5 0
      embed/etcd.go

+ 5 - 0
embed/etcd.go

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