mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:00:43 +00:00
perf: lazy load bluebubbles catchup
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtime";
|
||||
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
||||
import type { NormalizedWebhookMessage } from "./monitor-normalize.js";
|
||||
import type { BlueBubblesCoreRuntime, WebhookTarget } from "./monitor-shared.js";
|
||||
import type { OpenClawConfig } from "./runtime-api.js";
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
normalizeLowercaseStringOrEmpty,
|
||||
normalizeOptionalLowercaseString,
|
||||
normalizeOptionalString,
|
||||
} from "openclaw/plugin-sdk/text-runtime";
|
||||
} from "openclaw/plugin-sdk/string-coerce-runtime";
|
||||
import {
|
||||
downloadBlueBubblesAttachment,
|
||||
fetchBlueBubblesMessageAttachments,
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import type { IncomingMessage, ServerResponse } from "node:http";
|
||||
import { safeEqualSecret } from "openclaw/plugin-sdk/browser-security-runtime";
|
||||
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
||||
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtime";
|
||||
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
||||
import { resolveBlueBubblesEffectiveAllowPrivateNetwork } from "./accounts.js";
|
||||
import { runBlueBubblesCatchup } from "./catchup.js";
|
||||
import { createBlueBubblesDebounceRegistry } from "./monitor-debounce.js";
|
||||
import {
|
||||
asRecord,
|
||||
@@ -385,11 +384,13 @@ export async function monitorBlueBubblesProvider(
|
||||
// same processMessage path webhooks use, and #66230's inbound dedupe
|
||||
// drops any GUID that was already handled, so this is safe even if a
|
||||
// live webhook raced the startup replay. See #66721.
|
||||
runBlueBubblesCatchup(target).catch((err) => {
|
||||
runtime.error?.(
|
||||
`[${account.accountId}] BlueBubbles catchup: unexpected failure: ${String(err)}`,
|
||||
);
|
||||
});
|
||||
import("./catchup.js")
|
||||
.then(({ runBlueBubblesCatchup }) => runBlueBubblesCatchup(target))
|
||||
.catch((err) => {
|
||||
runtime.error?.(
|
||||
`[${account.accountId}] BlueBubbles catchup: unexpected failure: ${String(err)}`,
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user