Skip to content
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

Implement Retry-After during heartbeats import #429

Open
muety opened this issue Nov 15, 2022 · 3 comments
Open

Implement Retry-After during heartbeats import #429

muety opened this issue Nov 15, 2022 · 3 comments

Comments

@muety
Copy link
Owner

muety commented Nov 15, 2022

Proper rate limiting middlewares (including caddy-ratelimit) will return a Retry-After header alongside 429 requests.

The WakaTime heartbeats import mechanism should respect this and retry the request instead of failing.

@muety muety added help wanted Extra attention is needed good first issue Good for newcomers technical_task prio c effort:2 labels Nov 15, 2022
@Zubayer204
Copy link

Zubayer204 commented Mar 18, 2024

Is this supposed to be implemented in the WakatimeRelayMiddleware where it sends the heartbeat to wakatime api? Or is there a separate importing mechanism that I am missing out?

Also, we should stop retrying after a certain number of times. What would be the best number for retrying attempts? Should there be a config for that?

@muety
Copy link
Owner Author

muety commented Mar 18, 2024

Hi @Zubayer204, thanks for jumping onto this. The retrial would be implemented as part of the WakaTime import mechanism - not to be confused with the relating, which is "opposite" direction.

But now that I think about it, to be honest, I think I'd want to implement this myself. Nit because I wouldn't trust your skills or something, but because I'd find it interesting to dive deeper into that topic.

Generally, you did everything just right by looking for the help wanted label.

Hope you didn't put too much work into this yet! Sorry.

@muety muety removed the help wanted Extra attention is needed label Mar 18, 2024
@Zubayer204
Copy link

Zubayer204 commented Mar 18, 2024

No worries! I appreciate your work. Thanks for making such an amazing project happen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants