@nsshunt/stsrunnerframework 1.0.120 → 1.0.121

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2387,12 +2387,14 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
2387
2387
  throw error;
2388
2388
  }
2389
2389
  });
2390
- __publicField(this, "GetWorkersSmall", async () => {
2390
+ // only include runners that are in the specified states.
2391
+ // Use [] to include all runners irrespective of state.
2392
+ __publicField(this, "GetWorkersSmall", async (states) => {
2391
2393
  try {
2392
2394
  await __privateGet(this, _SyncWorkerDataFromWorkers).call(this);
2393
2395
  const retVal = {};
2394
2396
  for (const [, workerEx] of Object.entries(__privateGet(this, _workersEx))) {
2395
- retVal[workerEx.id] = this.CreateWorkerCopySmall(workerEx);
2397
+ retVal[workerEx.id] = this.CreateWorkerCopySmall(workerEx, states);
2396
2398
  }
2397
2399
  return retVal;
2398
2400
  } catch (error) {
@@ -3256,15 +3258,15 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
3256
3258
  throw error;
3257
3259
  }
3258
3260
  }
3259
- CreateWorkerCopySmall(workerEx) {
3261
+ CreateWorkerCopySmall(workerEx, states) {
3260
3262
  try {
3261
3263
  const workerCopy = {
3262
3264
  id: workerEx.id,
3263
3265
  runners: {}
3264
3266
  };
3265
- for (const [, runnerEx] of Object.entries(workerEx.runnersEx)) {
3267
+ Object.values(workerEx.runnersEx).filter((runnerEx) => states.length === 0 ? true : states.includes(runnerEx.state)).forEach((runnerEx) => {
3266
3268
  workerCopy.runners[runnerEx.id] = this.CreateRunnerCopySmall(runnerEx);
3267
- }
3269
+ });
3268
3270
  return workerCopy;
3269
3271
  } catch (error) {
3270
3272
  __privateGet(this, _error2).call(this, `CreateWorkerCopySmall(): Error: [${error}]`);