refactor: create pid file.
This commit is contained in:
parent
975a6f8fab
commit
fd22832e7c
3
main.go
3
main.go
|
@ -72,8 +72,7 @@ func createPIDFile() error {
|
||||||
return fmt.Errorf("Can't create PID file: %v", err)
|
return fmt.Errorf("Can't create PID file: %v", err)
|
||||||
}
|
}
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
_, err = file.WriteString(strconv.FormatInt(int64(currentPid), 10))
|
if _, err := file.WriteString(strconv.FormatInt(int64(currentPid), 10)); err != nil {
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("Can'write PID information on %s: %v", gorush.PushConf.Core.PID.Path, err)
|
return fmt.Errorf("Can'write PID information on %s: %v", gorush.PushConf.Core.PID.Path, err)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue