@mastra/deployer 1.38.0-alpha.4 → 1.38.0-alpha.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.
- package/CHANGELOG.md +10 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/server/index.cjs +32 -0
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +32 -0
- package/dist/server/index.js.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @mastra/deployer
|
|
2
2
|
|
|
3
|
+
## 1.38.0-alpha.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- The server now installs SIGINT/SIGTERM handlers and runs `mastra.shutdown()` before exiting, allowing storage backends to release resources cleanly instead of being terminated mid-flight. ([#17413](https://github.com/mastra-ai/mastra/pull/17413))
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`a18775a`](https://github.com/mastra-ai/mastra/commit/a18775a693172546ee2378d39b67d4e32895b251), [`1baf2d1`](https://github.com/mastra-ai/mastra/commit/1baf2d152c6881338ff8f114633d5316fe13dd15), [`309f7c9`](https://github.com/mastra-ai/mastra/commit/309f7c9899ee6870a07a16690a091c6ba7af4e1e), [`66d65f5`](https://github.com/mastra-ai/mastra/commit/66d65f58e4b1f862c7f7928866a4426f8de9d583)]:
|
|
10
|
+
- @mastra/core@1.38.0-alpha.5
|
|
11
|
+
- @mastra/server@1.38.0-alpha.5
|
|
12
|
+
|
|
3
13
|
## 1.38.0-alpha.4
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/dist/docs/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: mastra-deployer
|
|
|
3
3
|
description: Documentation for @mastra/deployer. Use when working with @mastra/deployer APIs, configuration, or implementation.
|
|
4
4
|
metadata:
|
|
5
5
|
package: "@mastra/deployer"
|
|
6
|
-
version: "1.38.0-alpha.
|
|
6
|
+
version: "1.38.0-alpha.5"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
package/dist/server/index.cjs
CHANGED
|
@@ -4472,6 +4472,38 @@ async function createNodeServer(mastra, options = { tools: {} }) {
|
|
|
4472
4472
|
} else {
|
|
4473
4473
|
await workerLifecycle.startEventEngine();
|
|
4474
4474
|
}
|
|
4475
|
+
const SHUTDOWN_TIMEOUT_MS = 5e3;
|
|
4476
|
+
let shuttingDown = false;
|
|
4477
|
+
const shutdown = async (signal) => {
|
|
4478
|
+
if (shuttingDown) {
|
|
4479
|
+
return;
|
|
4480
|
+
}
|
|
4481
|
+
shuttingDown = true;
|
|
4482
|
+
const logger2 = mastra.getLogger();
|
|
4483
|
+
logger2.info("Shutting down Mastra server", { signal });
|
|
4484
|
+
server.close();
|
|
4485
|
+
const lifecycle = mastra;
|
|
4486
|
+
if (typeof lifecycle.shutdown === "function") {
|
|
4487
|
+
let timeout2;
|
|
4488
|
+
const timedOut = /* @__PURE__ */ Symbol("shutdown-timeout");
|
|
4489
|
+
const timeoutPromise = new Promise((resolve) => {
|
|
4490
|
+
timeout2 = setTimeout(() => resolve(timedOut), SHUTDOWN_TIMEOUT_MS);
|
|
4491
|
+
});
|
|
4492
|
+
try {
|
|
4493
|
+
const result = await Promise.race([lifecycle.shutdown(), timeoutPromise]);
|
|
4494
|
+
if (result === timedOut) {
|
|
4495
|
+
logger2.warn("Mastra shutdown timed out; forcing exit", { timeoutMs: SHUTDOWN_TIMEOUT_MS });
|
|
4496
|
+
}
|
|
4497
|
+
} catch (error) {
|
|
4498
|
+
logger2.error("Error during Mastra shutdown", { error });
|
|
4499
|
+
} finally {
|
|
4500
|
+
clearTimeout(timeout2);
|
|
4501
|
+
}
|
|
4502
|
+
}
|
|
4503
|
+
process.exit(0);
|
|
4504
|
+
};
|
|
4505
|
+
process.once("SIGINT", () => void shutdown("SIGINT"));
|
|
4506
|
+
process.once("SIGTERM", () => void shutdown("SIGTERM"));
|
|
4475
4507
|
return server;
|
|
4476
4508
|
}
|
|
4477
4509
|
|