()
| 242 | } |
| 243 | |
| 244 | func (ep *EtcdServerProcess) Close() error { |
| 245 | ep.cfg.lg.Info("closing server...", zap.String("name", ep.cfg.Name)) |
| 246 | if err := ep.Stop(); err != nil { |
| 247 | return err |
| 248 | } |
| 249 | |
| 250 | if !ep.cfg.KeepDataDir { |
| 251 | ep.cfg.lg.Info("removing directory", zap.String("data-dir", ep.cfg.DataDirPath)) |
| 252 | return os.RemoveAll(ep.cfg.DataDirPath) |
| 253 | } |
| 254 | return nil |
| 255 | } |
| 256 | |
| 257 | func (ep *EtcdServerProcess) waitReady(ctx context.Context) error { |
| 258 | defer close(ep.donec) |