docs(rate-limit): clarify awaited cleanup

This commit is contained in:
Gustavo Valverde
2026-08-04 18:55:06 -04:00
parent 194c7a38a2
commit d3f00b7388
@@ -223,8 +223,9 @@ function createDatabaseStorageWrapper(
};
};
// Best-effort sweep of clearly-expired rows to bound table growth. A failure
// here never blocks the request.
// Best-effort sweep of clearly-expired rows to bound table growth. Without a
// background handler, the request awaits cleanup so it survives teardown;
// failures are logged and do not reject the request.
const deleteExpiredRows = async (now: number) => {
const cutoff = now - longestObservedWindow * 1000;
await ctx.runInBackgroundOrAwait(