This commit is contained in:
Your Name
2024-02-16 17:44:38 -06:00
parent be57e96588
commit 0d8e764b7b

View File

@@ -7,13 +7,15 @@ const socketPath = '/tmp/oscar_watcher.sock';
let progvars = {}; let progvars = {};
// Remove the socket file if it already exists // Remove the socket file if it already exists
try { if (fs.existsSync( socketPath )) {
try {
fs.unlinkSync(socketPath); fs.unlinkSync(socketPath);
} catch (err) { } catch (err) {
if (err.code !== 'ENOENT') { if (err.code !== 'ENOENT') {
console.error('Error removing existing socket file:', err); console.error('Error removing existing socket file:', err);
process.exit(1); process.exit(1);
} }
}
} }
const unix_socket_server = net.createServer((connection) => { const unix_socket_server = net.createServer((connection) => {