Force exit felt tool on sigint, sigterm (flutter/engine#12443)
This commit is contained in:
@@ -25,6 +25,8 @@ void main(List<String> args) async {
|
||||
io.exit(64); // Exit code 64 indicates a usage error.
|
||||
}
|
||||
|
||||
_listenToShutdownSignals();
|
||||
|
||||
try {
|
||||
final bool result = await runner.run(args);
|
||||
if (result == false) {
|
||||
@@ -41,3 +43,14 @@ void main(List<String> args) async {
|
||||
// Sometimes the Dart VM refuses to quit.
|
||||
io.exit(io.exitCode);
|
||||
}
|
||||
|
||||
void _listenToShutdownSignals() {
|
||||
io.ProcessSignal.sigint.watch().listen((_) {
|
||||
print('Received SIGINT. Shutting down.');
|
||||
io.exit(1);
|
||||
});
|
||||
io.ProcessSignal.sigterm.watch().listen((_) {
|
||||
print('Received SIGTERM. Shutting down.');
|
||||
io.exit(1);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user