mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-20 13:41:30 +00:00
fix(reply): refresh followup drain callbacks
This commit is contained in:
committed by
Peter Steinberger
parent
bcaadc39ea
commit
a35dcf608e
@@ -1,6 +1,6 @@
|
||||
import { resolveGlobalDedupeCache } from "../../../infra/dedupe.js";
|
||||
import { applyQueueDropPolicy, shouldSkipQueueItem } from "../../../utils/queue-helpers.js";
|
||||
import { kickFollowupDrainIfIdle } from "./drain.js";
|
||||
import { kickFollowupDrainIfIdle, rememberFollowupDrainCallback } from "./drain.js";
|
||||
import { getExistingFollowupQueue, getFollowupQueue } from "./state.js";
|
||||
import type { FollowupRun, QueueDedupeMode, QueueSettings } from "./types.js";
|
||||
|
||||
@@ -59,6 +59,7 @@ export function enqueueFollowupRun(
|
||||
run: FollowupRun,
|
||||
settings: QueueSettings,
|
||||
dedupeMode: QueueDedupeMode = "message-id",
|
||||
runFollowup?: (run: FollowupRun) => Promise<void>,
|
||||
): boolean {
|
||||
const queue = getFollowupQueue(key, settings);
|
||||
const recentMessageIdKey = dedupeMode !== "none" ? buildRecentMessageIdKey(run, key) : undefined;
|
||||
@@ -92,6 +93,9 @@ export function enqueueFollowupRun(
|
||||
if (recentMessageIdKey) {
|
||||
RECENT_QUEUE_MESSAGE_IDS.check(recentMessageIdKey);
|
||||
}
|
||||
if (runFollowup) {
|
||||
rememberFollowupDrainCallback(key, runFollowup);
|
||||
}
|
||||
// If drain finished and deleted the queue before this item arrived, a new queue
|
||||
// object was created (draining: false) but nobody scheduled a drain for it.
|
||||
// Use the cached callback to restart the drain now.
|
||||
|
||||
Reference in New Issue
Block a user