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

INCR with initial TTL #24

Closed
alexist opened this issue Nov 17, 2023 · 1 comment
Closed

INCR with initial TTL #24

alexist opened this issue Nov 17, 2023 · 1 comment

Comments

@alexist
Copy link
Contributor

alexist commented Nov 17, 2023

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

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
@grrolland
Copy link
Owner

Thanks for your PR.

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