Skip to content

Commit d55da54

Browse files
committed
fix: make graceful shutdown configurable
1 parent f9b2c6c commit d55da54

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/bin/mcp-proxy.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ const argv = await yargs(hideBin(process.argv))
4747
describe: "The endpoint to listen on",
4848
type: "string",
4949
},
50+
gracefulShutdownTimeout: {
51+
default: 5000,
52+
describe: "The timeout (in milliseconds) for graceful shutdown",
53+
type: "number",
54+
},
5055
host: {
5156
default: "::",
5257
describe: "The host to listen on",
@@ -179,7 +184,7 @@ const main = async () => {
179184

180185
setTimeout(() => {
181186
process.exit(0);
182-
}, 1000).unref();
187+
}, argv.gracefulShutdownTimeout).unref();
183188
});
184189
} catch (error) {
185190
console.error("could not start the proxy", error);

0 commit comments

Comments
 (0)