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