Skip to content

Commit 38a3a5d

Browse files
committed
fix(bin): handle SIGTERM signal support on non-Windows platforms
- Add a platform check before listening for SIGTERM signal - Prevent errors on Windows platforms that don't support SIGTERM
1 parent a46581e commit 38a3a5d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bin/main.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ Future<void> main(List<String> args) async {
5656

5757
// Listen for termination signals.
5858
ProcessSignal.sigint.watch().listen((_) => shutdown('SIGINT'));
59-
ProcessSignal.sigterm.watch().listen((_) => shutdown('SIGTERM'));
59+
// SIGTERM is not supported on Windows. Attempting to listen to it will throw.
60+
if (!Platform.isWindows) {
61+
ProcessSignal.sigterm.watch().listen((_) => shutdown('SIGTERM'));
62+
}
6063

6164
try {
6265
log.info('EAGER_INIT: Initializing application dependencies...');

0 commit comments

Comments
 (0)