cleaning up socket file

This commit is contained in:
Shlomi Noach 2016-08-11 09:01:14 +02:00
parent 0d62f362b7
commit dd1ef29dac
2 changed files with 6 additions and 0 deletions

View File

@ -399,6 +399,8 @@ func (this *Migrator) Migrate() (err error) {
if err := this.initiateServer(); err != nil {
return err
}
defer this.server.RemoveSocketFile()
if this.migrationContext.CountTableRows {
if this.migrationContext.Noop {
log.Debugf("Noop operation; not really counting table rows")

View File

@ -47,6 +47,10 @@ func (this *Server) BindSocketFile() (err error) {
return nil
}
func (this *Server) RemoveSocketFile() (err error) {
return os.Remove(this.migrationContext.ServeSocketFile)
}
func (this *Server) BindTCPPort() (err error) {
if this.migrationContext.ServeTCPPort == 0 {
return nil