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

Remaining Time Removal #152

Open
rexdjw opened this issue Feb 20, 2024 · 3 comments
Open

Remaining Time Removal #152

rexdjw opened this issue Feb 20, 2024 · 3 comments

Comments

@rexdjw
Copy link

rexdjw commented Feb 20, 2024

I'm upgrading a new project to the current release version and I noticed that the remaining time key was removed from the exception meta info. What is the new process that we're expected to use? That key was very useful for rescheduling calls

@vutran1710
Copy link
Owner

In case of rescheduling, can you just use delay?

@rexdjw
Copy link
Author

rexdjw commented Feb 20, 2024

Well, I see 2 issues with delay. Please correct me where my assumptions are wrong.

First, without the remaining time, I don't have a way to set a delay in such a manner that it guarantees that the request fires, or efficiently fires. It's either waiting an unnecessary amount of time or not waiting long enough (and canceling).

Second, my rate limiting integration is coupled with celery (which doesn't support async). Therefore, having a worker sit in a time.sleep waiting on a delay call isn't very ideal. It was quite convenient to schedule a new celery task on the time remaining field. While I understand that you can't support all design decisions, the removal of the time remaining makes the calls volatile in such a manner that rescheduling them efficiently doesn't appear possible. Even for users running the limiter async in an event loop, the delay is either excessive, or the request must be rescheduled an indeterminable number of times while running a conservative delay.

@vutran1710
Copy link
Owner

I see your point! I'll address the problem soon.

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

No branches or pull requests

2 participants