
























@@ -71,8 +71,8 @@ function recoverPendingOutboundDeliveries(params: {
7171function recoverPendingSessionDeliveries(params: {
7272deps: import("../cli/deps.types.js").CliDeps;
7373log: GatewayRuntimeServiceLogger;
74+maxEnqueuedAt: number;
7475}): void {
75-const maxEnqueuedAt = Date.now();
7676const timer = setTimeout(() => {
7777void (async () => {
7878const { recoverPendingRestartContinuationDeliveries } =
@@ -81,7 +81,7 @@ function recoverPendingSessionDeliveries(params: {
8181await recoverPendingRestartContinuationDeliveries({
8282deps: params.deps,
8383log: logRecovery,
84- maxEnqueuedAt,
84+maxEnqueuedAt: params.maxEnqueuedAt,
8585});
8686})().catch((err) => params.log.error(`Session delivery recovery failed: ${String(err)}`));
8787}, 1_250);
@@ -98,7 +98,6 @@ export function startGatewayRuntimeServices(params: {
9898channelHealthMonitor: ChannelHealthMonitor | null;
9999stopModelPricingRefresh: () => void;
100100} {
101-// Keep scheduled work inert until post-attach sidecars finish.
102101const channelHealthMonitor = startGatewayChannelHealthMonitor({
103102cfg: params.cfgAtStart,
104103channelManager: params.channelManager,
@@ -114,14 +113,11 @@ export function startGatewayRuntimeServices(params: {
114113};
115114}
116115117-/**
118- * Activate cron scheduler, heartbeat runner, and pending delivery recovery
119- * after gateway sidecars are fully started and chat.history is available.
120- */
121116export function activateGatewayScheduledServices(params: {
122117minimalTestGateway: boolean;
123118cfgAtStart: OpenClawConfig;
124119deps: import("../cli/deps.types.js").CliDeps;
120+sessionDeliveryRecoveryMaxEnqueuedAt: number;
125121cron: { start: () => Promise<void> };
126122logCron: { error: (message: string) => void };
127123log: GatewayRuntimeServiceLogger;
@@ -141,6 +137,7 @@ export function activateGatewayScheduledServices(params: {
141137recoverPendingSessionDeliveries({
142138deps: params.deps,
143139log: params.log,
140+maxEnqueuedAt: params.sessionDeliveryRecoveryMaxEnqueuedAt,
144141});
145142return { heartbeatRunner };
146143}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。