mirror of
https://github.com/hanzoai/dataroom.git
synced 2026-10-30 18:41:07 +00:00
- 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
21 lines
682 B
TypeScript
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" };
|
|
},
|
|
};
|