fix(core): Support task runner in execute and execute-batch commands (#15147)

This commit is contained in:
Iván Ovejero
2025-05-06 17:53:36 +02:00
committed by GitHub
parent 1e5cb55494
commit 985f554501
7 changed files with 196 additions and 15 deletions

View File

@@ -69,6 +69,9 @@ export abstract class BaseCommand extends Command {
/** Whether to init community packages (if enabled) */
protected needsCommunityPackages = false;
/** Whether to init task runner (if enabled). */
protected needsTaskRunner = false;
protected async loadModules() {
for (const moduleName of this.modulesConfig.modules) {
let preInitModule: ModulePreInit | undefined;
@@ -156,6 +159,11 @@ export abstract class BaseCommand extends Command {
await Container.get(CommunityPackagesService).checkForMissingPackages();
}
if (this.needsTaskRunner && this.globalConfig.taskRunners.enabled) {
const { TaskRunnerModule } = await import('@/task-runners/task-runner-module');
await Container.get(TaskRunnerModule).start();
}
// TODO: remove this after the cyclic dependencies around the event-bus are resolved
Container.get(MessageEventBus);