fix(server): non-HTTP entrypoints run inside an ORM request context; permission loads fail closed on context errors

This commit is contained in:
jubnl
2026-09-22 13:25:17 +02:00
parent 86c558cdd6
commit e9391a9ae1
23 changed files with 464 additions and 36 deletions
+3
View File
@@ -21,6 +21,9 @@ export class DemoResetJob implements OnApplicationBootstrap {
onApplicationBootstrap(): void {
if (!this.registrar.isEnabled() || !this.runtimeEnv.isDemoMode()) return;
// D6: resetDemoUser is all raw better-sqlite3 (see demo-reset.ts) — no
// repository read today — but the tick already runs inside a request context
// regardless, via CronRegistrarService's one wrapper around every onTick.
this.registrar.register('demo-reset', '0 * * * *', () => void this.tick(), { timezone: 'none' });
logInfo('Demo hourly reset scheduled');
}