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:
@@ -75,12 +75,16 @@ function spawnGogServe(cfg: GmailHookRuntimeConfig): ChildProcess {
|
||||
|
||||
child.stdout?.on("data", (data: Buffer) => {
|
||||
const line = data.toString().trim();
|
||||
if (line) log.info(`[gog] ${line}`);
|
||||
if (line) {
|
||||
log.info(`[gog] ${line}`);
|
||||
}
|
||||
});
|
||||
|
||||
child.stderr?.on("data", (data: Buffer) => {
|
||||
const line = data.toString().trim();
|
||||
if (!line) return;
|
||||
if (!line) {
|
||||
return;
|
||||
}
|
||||
if (isAddressInUseError(line)) {
|
||||
addressInUse = true;
|
||||
}
|
||||
@@ -92,7 +96,9 @@ function spawnGogServe(cfg: GmailHookRuntimeConfig): ChildProcess {
|
||||
});
|
||||
|
||||
child.on("exit", (code, signal) => {
|
||||
if (shuttingDown) return;
|
||||
if (shuttingDown) {
|
||||
return;
|
||||
}
|
||||
if (addressInUse) {
|
||||
log.warn(
|
||||
"gog serve failed to bind (address already in use); stopping restarts. " +
|
||||
@@ -104,7 +110,9 @@ function spawnGogServe(cfg: GmailHookRuntimeConfig): ChildProcess {
|
||||
log.warn(`gog exited (code=${code}, signal=${signal}); restarting in 5s`);
|
||||
watcherProcess = null;
|
||||
setTimeout(() => {
|
||||
if (shuttingDown || !currentConfig) return;
|
||||
if (shuttingDown || !currentConfig) {
|
||||
return;
|
||||
}
|
||||
watcherProcess = spawnGogServe(currentConfig);
|
||||
}, 5000);
|
||||
});
|
||||
@@ -180,7 +188,9 @@ export async function startGmailWatcher(cfg: OpenClawConfig): Promise<GmailWatch
|
||||
// Set up renewal interval
|
||||
const renewMs = runtimeConfig.renewEveryMinutes * 60_000;
|
||||
renewInterval = setInterval(() => {
|
||||
if (shuttingDown) return;
|
||||
if (shuttingDown) {
|
||||
return;
|
||||
}
|
||||
void startGmailWatch(runtimeConfig);
|
||||
}, renewMs);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user