triggerdotdev / trigger.dev

Trigger.dev is the open source background jobs platform.
https://trigger.dev/changelog
Apache License 2.0
9.12k stars 563 forks source link

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

Open ericallam opened 1 year ago

ericallam commented 1 year ago

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 commented 1 year ago

/bounty $100

algora-pbc[bot] commented 1 year ago

💎 $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
Akshay-Patel-dev commented 1 year ago

/attempt #305

Options
Chigala commented 1 year ago

/attempt #310

Options
algora-pbc[bot] commented 1 year ago

@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] commented 1 year ago

💡 @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.

MAYANK-TRIPATH commented 1 year ago

/attempt #310

Options
RamK777-stack commented 1 year ago

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

Options
algora-pbc[bot] commented 1 year ago

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

algora-pbc[bot] commented 1 year ago

@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] commented 1 year ago

@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] commented 1 year ago

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

rishi-raj-jain commented 11 months ago

@samejr

I think this issue is resolved?

ericallam commented 11 months ago

@rishi-raj-jain

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