Files
zeekay d110a71495 Replace Upstash with Hanzo KV (ioredis wire-compatible client)
- Remove @upstash/redis, @upstash/ratelimit, @upstash/qstash
- Add ioredis for Hanzo KV wire protocol compatibility
- Rewrite lib/redis.ts with Upstash-compatible shims over ioredis
- Rewrite tus-redis-locker.ts to use ioredis types
- Replace @upstash/ratelimit with sliding-window impl over KV
- Stub qstash in lib/cron (not used in production)
- Env: KV_URL replaces UPSTASH_REDIS_REST_URL
2026-03-01 08:09:53 -08:00

21 lines
682 B
TypeScript

import Bottleneck from "bottleneck";
// we're using Bottleneck to avoid running into Resend's rate limit of 10 req/s
export const limiter = new Bottleneck({
maxConcurrent: 1, // maximum concurrent requests
minTime: 100, // minimum time between requests in ms
});
// Stub receiver that always verifies (no Upstash qstash)
export const receiver = {
verify: async (_opts: { signature?: string; body: string }) => true,
};
// Stub qstash client (cron jobs run via standard scheduler, not qstash)
export const qstash = {
publishJSON: async (_opts: any) => {
console.warn("qstash.publishJSON called but qstash is not configured");
return { messageId: "noop" };
},
};