Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(signal): refactor signal handling across platforms #17

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

appleboy
Copy link
Owner

  • Refactor signal handling in manager.go to use a slice of signals instead of individual signal constants.
  • Remove handling of SIGTSTP signal and associated logging in manager.go.
  • Update signal sending in tests within manager_test.go to use os.FindProcess and process.Signal instead of syscall.Kill.
  • Add os package import in manager_test.go.
  • Create new file signals_unix.go with a slice of signals for Unix-based systems including SIGINT, SIGTERM, and SIGTSTP.
  • Create new file signals_windows.go with a slice of signals for Windows systems including SIGINT and SIGTERM.

- Refactor signal handling in `manager.go` to use a slice of signals instead of individual signal constants.
- Remove handling of `SIGTSTP` signal and associated logging in `manager.go`.
- Update signal sending in tests within `manager_test.go` to use `os.FindProcess` and `process.Signal` instead of `syscall.Kill`.
- Add `os` package import in `manager_test.go`.
- Create new file `signals_unix.go` with a slice of signals for Unix-based systems including `SIGINT`, `SIGTERM`, and `SIGTSTP`.
- Create new file `signals_windows.go` with a slice of signals for Windows systems including `SIGINT` and `SIGTERM`.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
@appleboy appleboy merged commit e167c34 into master Mar 13, 2024
9 of 10 checks passed
@appleboy appleboy deleted the signals branch March 13, 2024 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant