Skip to content

Commit

Permalink
Replace syscall.Kill with os.FindProcess / Signal for windows compati…
Browse files Browse the repository at this point in the history
…bility
  • Loading branch information
Matt-Lougheed authored and mperham committed Sep 29, 2022
1 parent 77f76ae commit 3e08c6d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ func heartbeat(mgr *Manager) {
// If our heartbeat expires, we must restart and re-authenticate.
// Use a signal so we can unwind and shutdown cleanly.
mgr.Logger.Warn("Faktory heartbeat has expired, shutting down...")
_ = syscall.Kill(os.Getpid(), syscall.SIGTERM)
if process, err := os.FindProcess(os.Getpid()); err != nil {
mgr.Logger.Errorf("Could not find worker process %d: %v", os.Getpid(), err)
} else {
_ = process.Signal(syscall.SIGTERM)
}
}
if err != nil || data == "" {
return err
Expand Down

0 comments on commit 3e08c6d

Please sign in to comment.