fix(sentry): skip "daemon not running" stop/reload errors
This commit is contained in:
parent
fceadd2009
commit
4d7444ef5b
6 changed files with 90 additions and 12 deletions
|
|
@ -262,9 +262,9 @@ func runDaemonReload() error {
|
|||
// stopDaemonByPID reads the state file and sends a graceful stop to the daemon PID.
|
||||
// Used as fallback on platforms without a service manager (and as Windows implementation).
|
||||
func stopDaemonByPID() error {
|
||||
state := agent.ReadState()
|
||||
if state == nil {
|
||||
return fmt.Errorf("daemon does not appear to be running (state file not found)")
|
||||
state, err := agent.LoadState()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return killPID(state.PID)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,9 +43,9 @@ func startReloadWatcher(rc *ReloadableConfig) {
|
|||
|
||||
// sendReloadSignal sends SIGUSR1 to the running daemon process.
|
||||
func sendReloadSignal() error {
|
||||
state := agent.ReadState()
|
||||
if state == nil {
|
||||
return fmt.Errorf("daemon does not appear to be running (state file not found)")
|
||||
state, err := agent.LoadState()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
p, err := os.FindProcess(state.PID)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue