trpc rate limiting
hi
I am currently having some problems with a race condition in my TRPC nextJS api.
Essentially what is happening is I have a
enforceGuildPermissions
method, which basically checks if the user who is making the request has permission to get the data for that guild.
The data is stored in my Redis cache for 3 seconds. This works okay sometimes, but other times because there is 3-4 different trpc requests running for a single page which are guild, role and channel. It causes the last request (channel) to get rate limited by the discord API because they are all running concurrently, this means it doesn't give my caching code chance to update it before the next one runs.
R
rustclan•396d ago
hopefully this makes sense, but I am completely stumped about what I can do to resolve this.
A big band aid fix would be to just add an artificial wait:
But obviously this is not very elegant..
4.8KMembers
View on DiscordMore Posts
trpc pipe middlewareHey all.
I'm currently trying to create a middle ware on endpoints using the new `pipe` API.
This Has anyone ever used tRPC (with SSR) and i18n?No matter the lib (next-intl, next-i18n, next-translate), I simply stumble from one problem to anothNew to tRPC and Need Help with BasicsI made a new T3 app, but I don't quite understand how tRPC works, and I would love to get some help web socket keeps on disconnecting and connectingHi! Its my first time using web sockets. The first code snippet is my socket code. The second code sPagination QueryHi, I'm new for web dev and I'm moved to tRPC not so long
I'm looking for example of pagination quEnrich the response object for TRPC endpointCurrently when I hit a trpc endpoint I get something like:
```typescript
{
result: {
data: