Initial working radio controller for OP25
This commit is contained in:
@@ -4,6 +4,7 @@ const log = new DebugBuilder("client", "clientController");
|
||||
|
||||
const spawn = require('child_process').spawn;
|
||||
const { resolve } = require("path");
|
||||
const { closeProcessWrapper } = require("../utilities/utilities");
|
||||
|
||||
// Global vars
|
||||
let pythonProcess;
|
||||
@@ -75,11 +76,7 @@ exports.leaveServer = async (req, res) => {
|
||||
log.INFO("Leaving the server");
|
||||
if (!pythonProcess) return res.sendStatus(200)
|
||||
|
||||
await pythonProcess.kill(2);
|
||||
await setTimeout(async () => {
|
||||
if (pythonProcess) await pythonProcess.kill(9);
|
||||
}, 25000)
|
||||
pythonProcess = undefined;
|
||||
pythonProcess = await closeProcessWrapper(pythonProcess);
|
||||
|
||||
return res.sendStatus(202);
|
||||
}
|
||||
Reference in New Issue
Block a user