-
Notifications
You must be signed in to change notification settings - Fork 6
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
INCR with initial TTL #24
Comments
alexist
pushed a commit
to alexist/ngx-distributed-shm
that referenced
this issue
Nov 17, 2023
alexist
pushed a commit
to alexist/ngx-distributed-shm
that referenced
this issue
Nov 17, 2023
grrolland
added a commit
that referenced
this issue
Nov 20, 2023
feat(#24): INCR with initial expiration
Thanks for your PR. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
The lua.shared semantic has evolved. The method incr now accept an optional parameter init_ttl :
syntax: newval, err, forcible? = ngx.shared.DICT:incr(key, value, init?, init_ttl?)
init_ttl allow to create the missing key with a ttl and avoid to make another call to handle expiration (incr than expire)
remaining, err = dict:incr(key, -1, limit, window)
I can submit a PR to add this new optional parameter in ngx-distributed-shm
The text was updated successfully, but these errors were encountered: