fix(core): Skip AuthRolesService.init() for workers to prevent scope deletion (#25245)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Andreas Fitzek
2026-02-04 09:55:20 +01:00
committed by GitHub
parent 50e1f66c8f
commit eaf805215e
+5 -1
View File
@@ -136,7 +136,11 @@ export abstract class BaseCommand<F = never> {
);
// Initialize the auth roles service to make sure that roles are correctly setup for the instance.
await Container.get(AuthRolesService).init();
// Only run on main instance - workers should not modify auth roles/scopes as they may have
// different code versions, and scope sync would incorrectly delete scopes they don't know about.
if (this.instanceSettings.instanceType === 'main') {
await Container.get(AuthRolesService).init();
}
if (process.env.EXECUTIONS_PROCESS === 'own') process.exit(-1);