Skip to content

How can we use waitUntil() in cloudflare workers with this rate limit. #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Ilikepizza2 opened this issue May 24, 2025 · 0 comments
Open

Comments

@Ilikepizza2
Copy link

Ilikepizza2 commented May 24, 2025

Hi, I actually have two questions -

  1. If we pass an already initialised upstash redis instance, is the same one used again or a new one is created?
export function getGlobalRedis(env: any): Redis {
  if (!globalRedis) {
    globalRedis = new Redis({
      url: env.UPSTASH_REDIS_REST_URL,
      token: env.UPSTASH_REDIS_REST_TOKEN,
    });
    console.log("🔄 Created global Redis connection");
  }
  return globalRedis;
}
  1. Can we somehow not wait for PEXPIRE commands of (eg, FixedWindow) like by using waitUntil() in cloudflare workers? We only need to read synchronously to block requests?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant