From 66d7c2f7b3913a7d291fabe3a72891f9267be164 Mon Sep 17 00:00:00 2001 From: Varga Zsolt Date: Wed, 1 Dec 2021 13:28:34 +0100 Subject: [PATCH] Timed restart in demo mode --- src/main.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.ts b/src/main.ts index 6e73aac7..34a3772b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -34,6 +34,11 @@ export async function main(modules: Constructor[]): Promise { // Register the shutdown hooks. process.on('SIGINT', shutdown.bind(shutdown)); process.on('SIGTERM', shutdown.bind(shutdown)); + + // Demo mode restarts every 30 minute, it rebuilds the database in case someone breaks it, yep Norbi, I mean You!... :D + if (process.env?.ARTGEN_DEMO === '1') { + setTimeout(() => kernel.stop(), 1_800_000); + } } else { process.exit(3); }