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

questions about allown and allownMost #68

Open
LetLifeStop opened this issue Oct 31, 2021 · 0 comments
Open

questions about allown and allownMost #68

LetLifeStop opened this issue Oct 31, 2021 · 0 comments

Comments

@LetLifeStop
Copy link

Q1: why does the code in function allown:

if remaining < 0 then
  local reset_after = tat - now
  local retry_after = diff * -1
  return {
    0, -- allowed
    0, -- remaining
    tostring(retry_after),
    tostring(reset_after),
  }
end

the remaining less zero? It should not be less than one when it should prompt that the current request cannot be precessed? like in function allownMost:

if remaining < 1 then
  local reset_after = tat - now
  local retry_after = emission_interval - diff
  return {
    0, -- allowed
    0, -- remaining
    tostring(retry_after),
    tostring(reset_after),
  }
end

Q: I can not understand the specific difference between these two function? can you explain in more detail? thank you~
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

1 participant