mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 21:53:43 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -332,7 +332,9 @@ export async function runGmailService(opts: GmailRunOptions) {
|
||||
}, renewMs);
|
||||
|
||||
const shutdown = () => {
|
||||
if (shuttingDown) return;
|
||||
if (shuttingDown) {
|
||||
return;
|
||||
}
|
||||
shuttingDown = true;
|
||||
clearInterval(renewTimer);
|
||||
child.kill("SIGTERM");
|
||||
@@ -342,10 +344,14 @@ export async function runGmailService(opts: GmailRunOptions) {
|
||||
process.on("SIGTERM", shutdown);
|
||||
|
||||
child.on("exit", () => {
|
||||
if (shuttingDown) return;
|
||||
if (shuttingDown) {
|
||||
return;
|
||||
}
|
||||
defaultRuntime.log("gog watch serve exited; restarting in 2s");
|
||||
setTimeout(() => {
|
||||
if (shuttingDown) return;
|
||||
if (shuttingDown) {
|
||||
return;
|
||||
}
|
||||
child = spawnGogServe(runtimeConfig);
|
||||
}, 2000);
|
||||
});
|
||||
@@ -365,7 +371,9 @@ async function startGmailWatch(
|
||||
const result = await runCommandWithTimeout(args, { timeoutMs: 120_000 });
|
||||
if (result.code !== 0) {
|
||||
const message = result.stderr || result.stdout || "gog watch start failed";
|
||||
if (fatal) throw new Error(message);
|
||||
if (fatal) {
|
||||
throw new Error(message);
|
||||
}
|
||||
defaultRuntime.error(message);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user