mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-17 21:10:54 +00:00
Merged via /review-pr -> /prepare-pr -> /merge-pr.
Prepared head SHA: 21e4045add
Co-authored-by: BinHPdev <219093083+BinHPdev@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
11 lines
342 B
TypeScript
11 lines
342 B
TypeScript
import { withTimeout } from "../../node-host/with-timeout.js";
|
|
|
|
export const EMBEDDED_COMPACTION_TIMEOUT_MS = 300_000;
|
|
|
|
export async function compactWithSafetyTimeout<T>(
|
|
compact: () => Promise<T>,
|
|
timeoutMs: number = EMBEDDED_COMPACTION_TIMEOUT_MS,
|
|
): Promise<T> {
|
|
return await withTimeout(() => compact(), timeoutMs, "Compaction");
|
|
}
|