Fix errors on windows

[ci skip]
This commit is contained in:
Szymon Uglis 2020-07-21 18:56:37 +02:00
parent 0bb20c29a3
commit b9f4278b0e
2 changed files with 11 additions and 7 deletions

View file

@ -193,9 +193,11 @@ class Nyxx implements Disposable {
throw MissingTokenError();
}
ProcessSignal.sigterm.watch().forEach((event) async {
await this.dispose();
});
if(!Platform.isWindows) {
ProcessSignal.sigterm.watch().forEach((event) async {
await this.dispose();
});
}
ProcessSignal.sigint.watch().forEach((event) async {
await this.dispose();

View file

@ -48,10 +48,12 @@ Future<void> _shardHandler(SendPort shardPort) async {
shardPort.send({ "cmd" : "TERMINATE_OK" });
}
// ignore: unawaited_futures
ProcessSignal.sigterm.watch().forEach((event) async {
await terminate();
});
if(!Platform.isWindows) {
// ignore: unawaited_futures
ProcessSignal.sigterm.watch().forEach((event) async {
await terminate();
});
}
// ignore: unawaited_futures
ProcessSignal.sigint.watch().forEach((event) async {