Merge f4c69a6cfc281fb4ee64546d27aff0e12a692fb3 into 5e417b44e1540f528d2ae63e3e20229a902d1db2
This commit is contained in:
commit
c3828f8c3f
@ -3,8 +3,11 @@ import { createDedupeCache } from "openclaw/plugin-sdk/infra-runtime";
|
||||
import type { TelegramContext } from "./bot/types.js";
|
||||
|
||||
const MEDIA_GROUP_TIMEOUT_MS = 500;
|
||||
const RECENT_TELEGRAM_UPDATE_TTL_MS = 5 * 60_000;
|
||||
const RECENT_TELEGRAM_UPDATE_MAX = 2000;
|
||||
// Dedup cache TTL must survive the longest possible polling restart cycle
|
||||
// (backoff up to 30s × multiple attempts + 90s stall threshold + 15s grace).
|
||||
// 30 minutes keeps entries alive well past any realistic restart window (#46674).
|
||||
const RECENT_TELEGRAM_UPDATE_TTL_MS = 30 * 60_000;
|
||||
const RECENT_TELEGRAM_UPDATE_MAX = 5000;
|
||||
|
||||
export type MediaGroupEntry = {
|
||||
messages: Array<{
|
||||
|
||||
@ -177,8 +177,12 @@ export class TelegramPollingSession {
|
||||
}
|
||||
try {
|
||||
await bot.api.getUpdates({ offset: lastUpdateId + 1, limit: 1, timeout: 0 });
|
||||
} catch {
|
||||
} catch (err) {
|
||||
// Non-fatal: runner middleware still skips duplicates via shouldSkipUpdate.
|
||||
// Log a warning so operators can diagnose duplicate-message issues (#46674).
|
||||
this.opts.log(
|
||||
`[telegram] failed to confirm persisted offset ${lastUpdateId}: ${formatErrorMessage(err)}; relying on dedup cache.`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user