@voltagent/core 0.1.85 → 0.1.86

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.d.mts CHANGED
@@ -7694,6 +7694,7 @@ declare class VoltAgent {
7694
7694
  * Setup graceful shutdown handlers
7695
7695
  */
7696
7696
  private setupShutdownHandlers;
7697
+ private isSoleSignalHandler;
7697
7698
  /**
7698
7699
  * Check for dependency updates
7699
7700
  */
package/dist/index.d.ts CHANGED
@@ -7694,6 +7694,7 @@ declare class VoltAgent {
7694
7694
  * Setup graceful shutdown handlers
7695
7695
  */
7696
7696
  private setupShutdownHandlers;
7697
+ private isSoleSignalHandler;
7697
7698
  /**
7698
7699
  * Check for dependency updates
7699
7700
  */
package/dist/index.js CHANGED
@@ -19667,14 +19667,21 @@ https://voltagent.dev/docs/observability/developer-console/#migration-guide-from
19667
19667
  try {
19668
19668
  await this.workflowRegistry.suspendAllActiveWorkflows();
19669
19669
  this.logger.info("[VoltAgent] All workflows suspended, exiting...");
19670
- process.exit(0);
19670
+ if (this.isSoleSignalHandler(signal)) {
19671
+ process.exit(0);
19672
+ }
19671
19673
  } catch (error) {
19672
19674
  this.logger.error("[VoltAgent] Error during shutdown:", { error });
19673
- process.exit(1);
19675
+ if (this.isSoleSignalHandler(signal)) {
19676
+ process.exit(1);
19677
+ }
19674
19678
  }
19675
19679
  }, "shutdown");
19676
- process.on("SIGTERM", () => shutdown("SIGTERM"));
19677
- process.on("SIGINT", () => shutdown("SIGINT"));
19680
+ process.once("SIGTERM", () => shutdown("SIGTERM"));
19681
+ process.once("SIGINT", () => shutdown("SIGINT"));
19682
+ }
19683
+ isSoleSignalHandler(event) {
19684
+ return process.listeners(event).length === 1;
19678
19685
  }
19679
19686
  /**
19680
19687
  * Check for dependency updates