Skip to content

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

@Ilikepizza2

Description

@Ilikepizza2

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions