Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

How to Return Time Until Quota Resets?

Not applicable

I'd like to return information about the current quota to the user via headers. I'm able to return the current limit and the remaining calls until the limit is reached, but I can't seem to find anything that lets me return when the limit will be reset. Quotas have a flow variable "ratelimit.{policy_name}.expiry.time", but this just seems to return the current time.

Is there any way for me to calculate when the quota for a particular user will be reset?

Thanks!

Solved Solved
1 12 2,514
1 ACCEPTED SOLUTION

Not applicable

As @Ozan Seymen mentioned rolling and flexi types are dynamic so they will not have a defined start time. However we can still have the time when the counter reset happens in the expiry time or probably the starttime stamp using which we can compute when the reset happens.

At present the expiry variable captures the time of request which is wrong .I think the docs has to clearly mention that .

View solution in original post

12 REPLIES 12