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

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";
@@ -503,7 +504,16 @@ async function configureBackgroundTask(coreConfig, envVars) {
503
504
  coreConfig.types.backgroundTaskComponent ??= [];
504
505
  if (isBackgroundTasksRequired(envVars)) {
505
506
  coreConfig.types.backgroundTaskComponent.push({
506
- type: BackgroundTaskComponentType.Service
507
+ type: BackgroundTaskComponentType.Service,
508
+ options: {
509
+ config: {
510
+ maxSystemWorkerCount: envCount(envVars, "backgroundTaskMaxSystemWorkerCount", cpus().length * 2),
511
+ taskInterval: envMs(envVars, "backgroundTaskInterval"),
512
+ retryInterval: envMs(envVars, "backgroundTaskRetryInterval"),
513
+ cleanupInterval: envMs(envVars, "backgroundTaskCleanupInterval"),
514
+ workerShutdownTimeout: envMs(envVars, "backgroundTaskWorkerShutdownTimeout")
515
+ }
516
+ }
507
517
  });
508
518
  }
509
519
  }
@@ -1735,6 +1745,8 @@ export function isTracingEnabled(envVars) {
1735
1745
  * @returns True if mailbox is enabled.
1736
1746
  */
1737
1747
  export function isMailboxEnabled(envVars) {
1738
- return commaSeparatedListToArray(envVars.emailProtocolConnector).some(t => t === EmailProtocolConnectorType.Imap || t === EmailProtocolConnectorType.Pop3);
1748
+ return commaSeparatedListToArray(envVars.emailProtocolConnector).some(t => t === EmailProtocolConnectorType.Imap ||
1749
+ t === EmailProtocolConnectorType.Pop3 ||
1750
+ t === EmailProtocolConnectorType.Gmail);
1739
1751
  }
1740
1752
  //# sourceMappingURL=engineEnvBuilder.js.map