@io-orkes/conductor-javascript 1.2.1-rc.3 → 1.2.1

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/browser.js CHANGED
@@ -2281,6 +2281,12 @@ var BaseHttpRequest = class {
2281
2281
  }
2282
2282
  };
2283
2283
 
2284
+ // src/task/constants.ts
2285
+ var DEFAULT_POLL_INTERVAL = 100;
2286
+ var DEFAULT_CONCURRENCY = 1;
2287
+ var DEFAULT_WARN_AT_O = 100;
2288
+ var DEFAULT_BATCH_POLLING_TIMEOUT = 100;
2289
+
2284
2290
  // src/task/Poller.ts
2285
2291
  var Poller = class {
2286
2292
  constructor(pollerId, pollFunction, performWorkFunction, pollerOptions, logger) {
@@ -2291,9 +2297,9 @@ var Poller = class {
2291
2297
  this._counterAtO = 0;
2292
2298
  this._pollerId = "";
2293
2299
  this.options = {
2294
- pollInterval: 100,
2295
- concurrency: 1,
2296
- warnAtO: 100
2300
+ pollInterval: DEFAULT_POLL_INTERVAL,
2301
+ concurrency: DEFAULT_CONCURRENCY,
2302
+ warnAtO: DEFAULT_WARN_AT_O
2297
2303
  };
2298
2304
  this.logger = noopLogger;
2299
2305
  /**
@@ -2325,7 +2331,7 @@ var Poller = class {
2325
2331
  0,
2326
2332
  this.options.concurrency - this._tasksInProcess
2327
2333
  );
2328
- if (count == 0) {
2334
+ if (count === 0) {
2329
2335
  this.logger.debug(
2330
2336
  "Max in process reached, Will skip polling for " + this._pollerId
2331
2337
  );
@@ -2377,10 +2383,10 @@ var noopErrorHandler = (__error) => {
2377
2383
  };
2378
2384
  var defaultRunnerOptions = {
2379
2385
  workerID: "",
2380
- pollInterval: 100,
2386
+ pollInterval: DEFAULT_POLL_INTERVAL,
2381
2387
  domain: void 0,
2382
- concurrency: 1,
2383
- batchPollingTimeout: 100
2388
+ concurrency: DEFAULT_CONCURRENCY,
2389
+ batchPollingTimeout: DEFAULT_BATCH_POLLING_TIMEOUT
2384
2390
  };
2385
2391
  var TaskRunner = class {
2386
2392
  constructor({
@@ -2445,7 +2451,7 @@ var TaskRunner = class {
2445
2451
  workflowInstanceId: task.workflowInstanceId,
2446
2452
  taskId: task.taskId
2447
2453
  });
2448
- this.logger.debug(`Finished polling for task ${task.taskId}`);
2454
+ this.logger.debug(`Task has executed successfully ${task.taskId}`);
2449
2455
  } catch (error) {
2450
2456
  await this.updateTaskWithRetry(task, {
2451
2457
  workflowInstanceId: task.workflowInstanceId,
@@ -2510,10 +2516,10 @@ var TaskRunner = class {
2510
2516
  var import_os = __toESM(require("os"));
2511
2517
  var defaultManagerOptions = {
2512
2518
  workerID: "",
2513
- pollInterval: 100,
2519
+ pollInterval: DEFAULT_POLL_INTERVAL,
2514
2520
  domain: void 0,
2515
- concurrency: 1,
2516
- batchPollingTimeout: 100
2521
+ concurrency: DEFAULT_CONCURRENCY,
2522
+ batchPollingTimeout: DEFAULT_BATCH_POLLING_TIMEOUT
2517
2523
  };
2518
2524
  function workerId(options) {
2519
2525
  return options.workerID ?? import_os.default.hostname();