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

feat(#24): INCR with initial expiration #25

Merged
merged 2 commits into from
Nov 20, 2023

Conversation

alexist
Copy link
Contributor

@alexist alexist commented Nov 17, 2023

Implementation of #24

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)

A new parameter has been added to INCR command in order to be compliant with lua.shared.DICT

@grrolland grrolland merged commit 9ac632c into grrolland:master Nov 20, 2023
@alexist alexist deleted the feat/24-INCR-with-initial-TTL branch November 25, 2023 11:55
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

Successfully merging this pull request may close these issues.

2 participants