feat: return Retry-After header in case of 429/Too Many Requests on thumbnail WebDAV endpoint
Description
https://github.com/owncloud/ocis/pull/9199#discussion_r1608337168
Related Issue
https://github.com/owncloud/ocis/pull/9199#discussion_r1608337168
Motivation and Context
https://github.com/owncloud/ocis/pull/9199#discussion_r1608337168
Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Technical debt
- [ ] Tests only (no source changes)
Checklist:
- [x] Code changes
- [ ] Unit tests added
- [ ] Acceptance tests added
- [ ] Documentation ticket raised:
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
hm, yeah ... determining a retry after timeout is hard. 5min is pretty long ... I'd start with 30sec and use an exponential backoff.
Also, the current Throttle limit is global ... maybe sth like https://github.com/go-chi/httprate with a limit on real ip and endpoint? urg but that requires common state, which is why there is https://github.com/go-chi/httprate-redis
since this is something I expect to be tweakable ... should we just add an env var for this?
Also, the current Throttle limit is global ... maybe sth like https://github.com/go-chi/httprate with a limit on real ip and endpoint? urg but that requires common state, which is why there is https://github.com/go-chi/httprate-redis
But this is more for real rate limiting which could be used for some kind of far usage of the thumbnail service. The existing implementation limits resource consumption of the thumbnail service.
Or am I miss-understanding your comment?
since this is something I expect to be tweakable ... should we just add an env var for this?
Two vars then? One for done and one for not done ....
hm, yeah ... determining a retry after timeout is hard. 5min is pretty long ... I'd start with 30sec and use an exponential backoff.
I didn't want to over-engineer this tbh :see_no_evil:
Please finish or close 😄
I should have written "finish" 😬
@butonic wants it -> please finish
Feel free to take over. Thx
IMO we need this to tell clients to actually retry fetching thumbnails.
This has been implemented in https://github.com/owncloud/ocis/pull/10280