address feedback

Signed-off-by: jrusso1020 <jrusso@brex.com>
This commit is contained in:
jrusso1020
2021-06-02 10:42:35 -04:00
parent 6fe1567a7c
commit ca5f400278
3 changed files with 5 additions and 9 deletions
+1 -1
View File
@@ -2,4 +2,4 @@
'@backstage/plugin-scaffolder-backend': minor
---
This adds a configuration option to the scaffolder plugin router, so we can allow for multiple taskworkers. Currently with only one taskworker you are limited to scaffolding one thing at a time. Set the `taskWorkers?: number` option in your scaffolder router to get more than 1 taskworker
This adds a configuration option to the scaffolder plugin router, so we can allow for multiple TaskWorkers. Currently with only one TaskWorker you are limited to scaffolding one thing at a time. Set the `taskWorkers?: number` option in your scaffolder router to get more than 1 TaskWorker
-4
View File
@@ -241,10 +241,6 @@ supertype
talkdesk
Talkdesk
tasklist
taskworker
Taskworker
taskworkers
Taskworkers
techdocs
Telenor
templated
@@ -105,16 +105,16 @@ export async function createRouter(
);
const taskBroker = new StorageTaskBroker(databaseTaskStore, logger);
const actionRegistry = new TemplateActionRegistry();
const workers = new Array(taskWorkers || 1);
workers.map(_ => {
const workers = [];
for (let i = 0; i < (taskWorkers || 1); i++) {
const worker = new TaskWorker({
logger,
taskBroker,
actionRegistry,
workingDirectory,
});
return worker;
});
workers.push(worker);
}
const actionsToRegister = Array.isArray(actions)
? actions