mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-07 22:09:57 +00:00
perf(test): trim duplicate e2e suites and harden signal hooks
This commit is contained in:
@@ -330,11 +330,17 @@ export async function runGmailService(opts: GmailRunOptions) {
|
||||
void startGmailWatch(runtimeConfig);
|
||||
}, renewMs);
|
||||
|
||||
const detachSignals = () => {
|
||||
process.off("SIGINT", shutdown);
|
||||
process.off("SIGTERM", shutdown);
|
||||
};
|
||||
|
||||
const shutdown = () => {
|
||||
if (shuttingDown) {
|
||||
return;
|
||||
}
|
||||
shuttingDown = true;
|
||||
detachSignals();
|
||||
clearInterval(renewTimer);
|
||||
child.kill("SIGTERM");
|
||||
};
|
||||
@@ -344,6 +350,7 @@ export async function runGmailService(opts: GmailRunOptions) {
|
||||
|
||||
child.on("exit", () => {
|
||||
if (shuttingDown) {
|
||||
detachSignals();
|
||||
return;
|
||||
}
|
||||
defaultRuntime.log("gog watch serve exited; restarting in 2s");
|
||||
|
||||
Reference in New Issue
Block a user