# @upstash/ratelimit on serverless: dont drop the pending promise
## The problem
limit() returns quickly, but two things still run in the background:
1. Multi-region sync between your Redis databases.
2. Analytics writes, if you enabled analytics.
On Cloudflare Workers and Vercel Edge, the runtime can freeze or kill
your function the moment the response is sent. Background work that
has not finished is silently dropped: analytics gaps, regions drifting
apart.
## The fix
const { success, pending } = await ratelimit.limit(identifier);
context.waitUntil(pending);
On Vercel Functions, use the waitUntil from the Functions API. On
Cloudflare, it is context.waitUntil. Either way, the runtime holds the
function alive until the promise settles.
## Checklist
- Always destructure pending, not just success.
- Call waitUntil before returning the response.
- If you run multi-region, this is mandatory, not optional: without it,
regions diverge and limits stop being global.
- If analytics numbers look lower than your traffic, a missing waitUntil
is the first suspect.