@io-orkes/conductor-javascript 1.2.2 → 1.2.3

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.
package/dist/index.mjs CHANGED
@@ -2281,6 +2281,15 @@ var Poller = class {
2281
2281
  }
2282
2282
  };
2283
2283
 
2284
+ // src/task/helpers.ts
2285
+ var optionEquals = (oldOptions, newOptions) => {
2286
+ const newOptionEntries = Object.entries(newOptions);
2287
+ const oldOptionsEntries = Object.entries(oldOptions);
2288
+ return newOptionEntries.length === oldOptionsEntries.length && newOptionEntries.every(
2289
+ ([key, value]) => oldOptions[key] === value
2290
+ );
2291
+ };
2292
+
2284
2293
  // src/task/TaskRunner.ts
2285
2294
  var DEFAULT_ERROR_MESSAGE = "An unknown error occurred";
2286
2295
  var MAX_RETRIES = 3;
@@ -2407,13 +2416,16 @@ var TaskRunner = class {
2407
2416
  }
2408
2417
  updateOptions(options) {
2409
2418
  const newOptions = { ...this.options, ...options };
2410
- this.poller.updateOptions({
2411
- concurrency: newOptions.concurrency,
2412
- pollInterval: newOptions.pollInterval
2413
- });
2414
- this.logger.info(
2415
- `TaskWorker ${this.worker.taskDefName} configuration updated with concurrency of ${this.poller.options.concurrency} and poll interval of ${this.poller.options.pollInterval}`
2416
- );
2419
+ const isOptionsUpdated = !optionEquals(this.options, newOptions);
2420
+ if (isOptionsUpdated) {
2421
+ this.poller.updateOptions({
2422
+ concurrency: newOptions.concurrency,
2423
+ pollInterval: newOptions.pollInterval
2424
+ });
2425
+ this.logger.info(
2426
+ `TaskWorker ${this.worker.taskDefName} configuration updated with concurrency of ${this.poller.options.concurrency} and poll interval of ${this.poller.options.pollInterval}`
2427
+ );
2428
+ }
2417
2429
  this.options = newOptions;
2418
2430
  }
2419
2431
  get getOptions() {
@@ -2591,7 +2603,13 @@ var WorkflowExecutor = class {
2591
2603
  */
2592
2604
  executeWorkflow(workflowRequest, name, version, requestId, waitUntilTaskRef = "") {
2593
2605
  return tryCatchReThrow(
2594
- () => this._client.workflowResource.executeWorkflow(workflowRequest, name, version, requestId, waitUntilTaskRef)
2606
+ () => this._client.workflowResource.executeWorkflow(
2607
+ workflowRequest,
2608
+ name,
2609
+ version,
2610
+ requestId,
2611
+ waitUntilTaskRef
2612
+ )
2595
2613
  );
2596
2614
  }
2597
2615
  startWorkflows(workflowsRequest) {