Skip to content

Commit

Permalink
Timed restart in demo mode
Browse files Browse the repository at this point in the history
  • Loading branch information
hisorange committed Dec 1, 2021
1 parent e1b2f12 commit 66d7c2f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ export async function main(modules: Constructor<IModule>[]): Promise<IKernel> {
// 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);
}
Expand Down

0 comments on commit 66d7c2f

Please sign in to comment.