trigger.dev icon indicating copy to clipboard operation
trigger.dev copied to clipboard

[TRI-1007] Better handle retrying rate-limited resend requests in `@trigger.dev/resend`

Open ericallam opened this issue 2 years ago • 14 comments

Resend has a rate limit of 10 requests per second. They also send Rate limit headers with every request, meaning we should be able to use the same method as we do in our GitHub integration to only retry a sendEmail task when it will actually succeed, instead of doing a backoff strategy.

The sendEmail task is defined here:

https://github.com/triggerdotdev/trigger.dev/blob/main/integrations/resend/src/index.ts#L10

You can see how we schedule retries using rate limiting headers in our github integration here:

https://github.com/triggerdotdev/trigger.dev/blob/c246578a8123cdd53bed819bee33cb16c85df561/integrations/github/src/tasks.ts#L18

TRI-1007

ericallam avatar Aug 11 '23 12:08 ericallam

/bounty $100

ericallam avatar Aug 11 '23 12:08 ericallam

💎 $100 bounty created by ericallam 🙋 If you start working on this, comment /attempt #310 to notify everyone 👉 To claim this bounty, submit a pull request that includes the text /claim #310 somewhere in its body 📝 Before proceeding, please make sure you can receive payouts in your country 💵 Payment arrives in your account 2-5 days after the bounty is rewarded 💯 You keep 100% of the bounty award 🙏 Thank you for contributing to triggerdotdev/trigger.dev!

Attempt Started (GMT+0) Solution
🔴 @RamK777-stack Aug 13, 2023, 2:26:46 PM WIP
🔴 @MAYANK-TRIPATH Aug 12, 2023, 4:39:51 AM WIP
🔴 @Chigala Aug 11, 2023, 1:41:29 PM WIP
🟡 @Akshay-Patel-dev Aug 11, 2023, 12:58:40 PM #320

algora-pbc[bot] avatar Aug 11 '23 12:08 algora-pbc[bot]

/attempt #305

Options

Akshay-Patel-dev avatar Aug 11 '23 12:08 Akshay-Patel-dev

/attempt #310

Options

Chigala avatar Aug 11 '23 13:08 Chigala

@Akshay-Patel-dev is already attempting to complete #310 and claim the bounty. If you attempt to complete the same issue, there is a chance that @Akshay-Patel-dev will complete the issue first, and be awarded the bounty. Try discussing with @Akshay-Patel-dev and potentially collaborating on the same solution versus creating an alternate solution.

algora-pbc[bot] avatar Aug 11 '23 13:08 algora-pbc[bot]

💡 @Akshay-Patel-dev submitted a pull request that claims the bounty. You can visit your org dashboard to reward. 👉 @Akshay-Patel-dev: To receive payouts, sign up on Algora, link your Github account and connect with Stripe on your dashboard.

algora-pbc[bot] avatar Aug 11 '23 19:08 algora-pbc[bot]

/attempt #310

Options

MAYANK-TRIPATH avatar Aug 12 '23 04:08 MAYANK-TRIPATH

/attempt https://github.com/triggerdotdev/trigger.dev/issues/305

Options

RamK777-stack avatar Aug 13 '23 14:08 RamK777-stack

@Chigala: Reminder that in 7 days the bounty will become up for grabs, so please submit a pull request before then 🙏

algora-pbc[bot] avatar Aug 18 '23 13:08 algora-pbc[bot]

@MAYANK-TRIPATH: Reminder that in 7 days the bounty will become up for grabs, so please submit a pull request before then 🙏

algora-pbc[bot] avatar Aug 19 '23 04:08 algora-pbc[bot]

@RamK777-stack: Reminder that in 7 days the bounty will become up for grabs, so please submit a pull request before then 🙏

algora-pbc[bot] avatar Aug 20 '23 14:08 algora-pbc[bot]

🎉🎈 @Akshay-Patel-dev has been awarded $100! 🎈🎊

algora-pbc[bot] avatar Aug 30 '23 09:08 algora-pbc[bot]

@samejr

I think this issue is resolved?

rishi-raj-jain avatar Nov 16 '23 12:11 rishi-raj-jain

@rishi-raj-jain

This is being help up due to the following issue: https://github.com/resendlabs/resend-node/issues/189

ericallam avatar Nov 16 '23 13:11 ericallam