add dependency-free node restart function as suggested by @KaKi87 https://github.com/RobinLinus/snapdrop/issues/515#issuecomment-1365403786

This commit is contained in:
schlagmichdoch 2022-12-30 17:13:09 +01:00
parent 009fcd7745
commit b691af71c0

View file

@ -26,6 +26,25 @@ process.on('unhandledRejection', (reason, promise) => {
console.log(reason) console.log(reason)
}) })
process.on(
'uncaughtException',
() => {
process.once(
'exit',
() => spawn(
process.argv.shift(),
process.argv,
{
cwd: process.cwd(),
detached: true,
stdio: 'inherit'
}
)
);
process.exit();
}
);
const express = require('express'); const express = require('express');
const RateLimit = require('express-rate-limit'); const RateLimit = require('express-rate-limit');
const http = require('http'); const http = require('http');