Skip to content

Commit

Permalink
server: use existing service control restart
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Jan 18, 2024
1 parent 9827f15 commit c7a9ca0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
1 change: 0 additions & 1 deletion server/src/scrypted-main-exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export function isChildProcess() {
}

function start(mainFilename: string, options?: {
restart?: () => void,
onRuntimeCreated?: (runtime: Runtime) => Promise<void>,
}) {
if (!global.gc) {
Expand Down
6 changes: 1 addition & 5 deletions server/src/scrypted-server-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ app.use(bodyParser.raw({ type: 'application/zip', limit: 100000000 }) as any)

async function start(mainFilename: string, options?: {
onRuntimeCreated?: (runtime: ScryptedRuntime) => Promise<void>,
restart?: () => void,
}) {
const volumeDir = getScryptedVolume();
await fs.promises.mkdir(volumeDir, {
Expand Down Expand Up @@ -380,10 +379,7 @@ async function start(mainFilename: string, options?: {
});
}

if (options?.restart)
options.restart();
else
process.exit();
scrypted.serviceControl.restart();
});

app.get('/web/component/backup', async (req, res) => {
Expand Down

0 comments on commit c7a9ca0

Please sign in to comment.