Merge pull request #147 from github/cleanup-socket-file
Cleanup socket file
This commit is contained in:
commit
8bf07c506f
@ -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")
|
||||
|
@ -47,6 +47,11 @@ func (this *Server) BindSocketFile() (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (this *Server) RemoveSocketFile() (err error) {
|
||||
log.Infof("Removing socket file: %s", this.migrationContext.ServeSocketFile)
|
||||
return os.Remove(this.migrationContext.ServeSocketFile)
|
||||
}
|
||||
|
||||
func (this *Server) BindTCPPort() (err error) {
|
||||
if this.migrationContext.ServeTCPPort == 0 {
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user