mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-08 08:39:59 +00:00
Terminate bridge process after handling SIGTERM
This commit is contained in:
@@ -185,9 +185,9 @@ export function stopMediaServer() {
|
||||
mediaServer.close(err => {
|
||||
if (err) {
|
||||
reject();
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
|
||||
resolve();
|
||||
});
|
||||
|
||||
mediaServer = undefined;
|
||||
|
||||
@@ -10,9 +10,11 @@ import { startMediaServer, stopMediaServer } from "./components/mediaServer";
|
||||
|
||||
import { applicationVersion } from "../../config.json";
|
||||
|
||||
process.on("SIGTERM", () => {
|
||||
process.on("SIGTERM", async () => {
|
||||
discovery?.stop();
|
||||
stopMediaServer();
|
||||
await stopMediaServer();
|
||||
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
let discovery: Discovery | null = null;
|
||||
|
||||
Reference in New Issue
Block a user