mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 21:51:24 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -17,7 +17,9 @@ function isRunAlreadyQueued(
|
||||
if (messageId) {
|
||||
return items.some((item) => item.messageId?.trim() === messageId && hasSameRouting(item));
|
||||
}
|
||||
if (!allowPromptFallback) return false;
|
||||
if (!allowPromptFallback) {
|
||||
return false;
|
||||
}
|
||||
return items.some((item) => item.prompt === run.prompt && hasSameRouting(item));
|
||||
}
|
||||
|
||||
@@ -35,7 +37,9 @@ export function enqueueFollowupRun(
|
||||
isRunAlreadyQueued(item, items, dedupeMode === "prompt");
|
||||
|
||||
// Deduplicate: skip if the same message is already queued.
|
||||
if (shouldSkipQueueItem({ item: run, items: queue.items, dedupe })) return false;
|
||||
if (shouldSkipQueueItem({ item: run, items: queue.items, dedupe })) {
|
||||
return false;
|
||||
}
|
||||
|
||||
queue.lastEnqueuedAt = Date.now();
|
||||
queue.lastRun = run.run;
|
||||
@@ -44,7 +48,9 @@ export function enqueueFollowupRun(
|
||||
queue,
|
||||
summarize: (item) => item.summaryLine?.trim() || item.prompt.trim(),
|
||||
});
|
||||
if (!shouldEnqueue) return false;
|
||||
if (!shouldEnqueue) {
|
||||
return false;
|
||||
}
|
||||
|
||||
queue.items.push(run);
|
||||
return true;
|
||||
@@ -52,8 +58,12 @@ export function enqueueFollowupRun(
|
||||
|
||||
export function getFollowupQueueDepth(key: string): number {
|
||||
const cleaned = key.trim();
|
||||
if (!cleaned) return 0;
|
||||
if (!cleaned) {
|
||||
return 0;
|
||||
}
|
||||
const queue = FOLLOWUP_QUEUES.get(cleaned);
|
||||
if (!queue) return 0;
|
||||
if (!queue) {
|
||||
return 0;
|
||||
}
|
||||
return queue.items.length;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user