Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 21e4045addca7a424828478d84dd5e4b202cbcfd 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");
|
|
}
|