mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 21:38:25 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -75,7 +75,9 @@ export function startGatewayMaintenanceTimers(params: {
|
||||
const dedupeCleanup = setInterval(() => {
|
||||
const now = Date.now();
|
||||
for (const [k, v] of params.dedupe) {
|
||||
if (now - v.ts > DEDUPE_TTL_MS) params.dedupe.delete(k);
|
||||
if (now - v.ts > DEDUPE_TTL_MS) {
|
||||
params.dedupe.delete(k);
|
||||
}
|
||||
}
|
||||
if (params.dedupe.size > DEDUPE_MAX) {
|
||||
const entries = [...params.dedupe.entries()].toSorted((a, b) => a[1].ts - b[1].ts);
|
||||
@@ -85,7 +87,9 @@ export function startGatewayMaintenanceTimers(params: {
|
||||
}
|
||||
|
||||
for (const [runId, entry] of params.chatAbortControllers) {
|
||||
if (now <= entry.expiresAtMs) continue;
|
||||
if (now <= entry.expiresAtMs) {
|
||||
continue;
|
||||
}
|
||||
abortChatRunById(
|
||||
{
|
||||
chatAbortControllers: params.chatAbortControllers,
|
||||
@@ -103,7 +107,9 @@ export function startGatewayMaintenanceTimers(params: {
|
||||
|
||||
const ABORTED_RUN_TTL_MS = 60 * 60_000;
|
||||
for (const [runId, abortedAt] of params.chatRunState.abortedRuns) {
|
||||
if (now - abortedAt <= ABORTED_RUN_TTL_MS) continue;
|
||||
if (now - abortedAt <= ABORTED_RUN_TTL_MS) {
|
||||
continue;
|
||||
}
|
||||
params.chatRunState.abortedRuns.delete(runId);
|
||||
params.chatRunBuffers.delete(runId);
|
||||
params.chatDeltaSentAt.delete(runId);
|
||||
|
||||
Reference in New Issue
Block a user