openresty / lua-resty-limit-traffic

Lua library for limiting and controlling traffic in OpenResty/ngx_lua
819 stars 150 forks source link

feature: implemented `resty.limit.count`. #21

Closed moonming closed 7 years ago

moonming commented 7 years ago

implemented resty.limit.count as GitHub request rate limiting: https://developer.github.com/v3/#rate-limiting

agentzh commented 7 years ago

@doujiang24 @dndx @membphis Will you please review this PR for me? Many thanks!

moonming commented 7 years ago

@agentzh @dndx can we merge this PR now? I will create a new PR to fix race condition after incr() support ttl.

moonming commented 7 years ago

@agentzh fixed the race condition by using the shdict:expire(). please have a look, thx.

agentzh commented 7 years ago

@thibaultcha @dndx Will you please review the new version of this PR? Thanks!

agentzh commented 7 years ago

Merged with minor edits. Thanks!

shawnzhu commented 7 years ago

@moonming @agentzh Thank you!