@twin.org/node-core 0.9.4-next.3 → 0.9.4-next.5

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.
@@ -1,5 +1,6 @@
1
1
  // Copyright 2024 IOTA Stiftung.
2
2
  // SPDX-License-Identifier: Apache-2.0.
3
+ import { cpus } from "node:os";
3
4
  import path from "node:path";
4
5
  import { Is, Mutex } from "@twin.org/core";
5
6
  import { EngineCloneMode } from "@twin.org/engine-models";
@@ -392,8 +393,7 @@ async function configureLogging(coreConfig, envVars) {
392
393
  retainForMs: envMinToMs(envVars, "loggingRetainFor"),
393
394
  maxEntries: envCount(envVars, "loggingMaxEntries"),
394
395
  retentionIntervalMs: envMinToMs(envVars, "loggingRetentionInterval"),
395
- retentionBatchSize: envCount(envVars, "loggingRetentionBatchSize"),
396
- mutexTimeoutMs: envMs(envVars, "loggingMutexTimeout")
396
+ retentionBatchSize: envCount(envVars, "loggingRetentionBatchSize")
397
397
  }
398
398
  }
399
399
  });
@@ -430,8 +430,7 @@ async function configureLogging(coreConfig, envVars) {
430
430
  directory: envVars.loggingFileDirectory ?? envVars.storageFileRoot ?? "",
431
431
  filename: envVars.loggingFileFilename,
432
432
  maxFileSizeBytes: envCount(envVars, "loggingFileMaxFileSizeBytes"),
433
- maxRetainedFiles: envCount(envVars, "loggingFileMaxRetainedFiles"),
434
- mutexTimeoutMs: envMs(envVars, "loggingMutexTimeout")
433
+ maxRetainedFiles: envCount(envVars, "loggingFileMaxRetainedFiles")
435
434
  }
436
435
  }
437
436
  });
@@ -503,7 +502,17 @@ async function configureBackgroundTask(coreConfig, envVars) {
503
502
  coreConfig.types.backgroundTaskComponent ??= [];
504
503
  if (isBackgroundTasksRequired(envVars)) {
505
504
  coreConfig.types.backgroundTaskComponent.push({
506
- type: BackgroundTaskComponentType.Service
505
+ type: BackgroundTaskComponentType.Service,
506
+ options: {
507
+ config: {
508
+ maxSystemWorkerCount: envCount(envVars, "backgroundTaskMaxSystemWorkerCount", cpus().length * 2),
509
+ taskInterval: envMs(envVars, "backgroundTaskInterval"),
510
+ retryInterval: envMs(envVars, "backgroundTaskRetryInterval"),
511
+ cleanupInterval: envMs(envVars, "backgroundTaskCleanupInterval"),
512
+ workerShutdownTimeout: envMs(envVars, "backgroundTaskWorkerShutdownTimeout"),
513
+ maxDispatchCount: envCount(envVars, "backgroundTaskMaxDispatchCount")
514
+ }
515
+ }
507
516
  });
508
517
  }
509
518
  }
@@ -1735,6 +1744,9 @@ export function isTracingEnabled(envVars) {
1735
1744
  * @returns True if mailbox is enabled.
1736
1745
  */
1737
1746
  export function isMailboxEnabled(envVars) {
1738
- return commaSeparatedListToArray(envVars.emailProtocolConnector).some(t => t === EmailProtocolConnectorType.Imap || t === EmailProtocolConnectorType.Pop3);
1747
+ return commaSeparatedListToArray(envVars.emailProtocolConnector).some(t => t === EmailProtocolConnectorType.Imap ||
1748
+ t === EmailProtocolConnectorType.Pop3 ||
1749
+ t === EmailProtocolConnectorType.Gmail ||
1750
+ t === EmailProtocolConnectorType.Outlook);
1739
1751
  }
1740
1752
  //# sourceMappingURL=engineEnvBuilder.js.map