mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-28 04:50:40 +00:00
build: fix ineffective dynamic imports with lazy boundaries (#33690)
Merged via squash.
Prepared head SHA: 38b3c23d6f
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
This commit is contained in:
committed by
GitHub
parent
a4850b1b8f
commit
21e8d88c1d
1
src/infra/outbound/deliver-runtime.ts
Normal file
1
src/infra/outbound/deliver-runtime.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { deliverOutboundPayloads } from "./deliver.js";
|
||||
@@ -15,6 +15,12 @@ type WarningParams = {
|
||||
|
||||
const warnedContexts = new Map<string, string>();
|
||||
const log = createSubsystemLogger("session-maintenance-warning");
|
||||
let deliverRuntimePromise: Promise<typeof import("./outbound/deliver-runtime.js")> | null = null;
|
||||
|
||||
function loadDeliverRuntime() {
|
||||
deliverRuntimePromise ??= import("./outbound/deliver-runtime.js");
|
||||
return deliverRuntimePromise;
|
||||
}
|
||||
|
||||
function shouldSendWarning(): boolean {
|
||||
return !process.env.VITEST && process.env.NODE_ENV !== "test";
|
||||
@@ -95,7 +101,7 @@ export async function deliverSessionMaintenanceWarning(params: WarningParams): P
|
||||
}
|
||||
|
||||
try {
|
||||
const { deliverOutboundPayloads } = await import("./outbound/deliver.js");
|
||||
const { deliverOutboundPayloads } = await loadDeliverRuntime();
|
||||
const outboundSession = buildOutboundSessionContext({
|
||||
cfg: params.cfg,
|
||||
sessionKey: params.sessionKey,
|
||||
|
||||
Reference in New Issue
Block a user