Closed kjdev closed 7 months ago
The overall change enhances the key-value storage functionality by introducing an optional timeout
parameter, which allows setting a time-to-live (TTL) for key-value pairs in specific directives. This update removes previous timeout
support in favor of a more flexible configuration, extends the directive to accept additional parameters, and implements the necessary logic to manage TTLs and timeouts within the shared memory context, ensuring key-value pairs are automatically deleted upon reaching their TTL.
Files | Summary |
---|---|
README.md |
Added an optional timeout parameter for the keyval_zone directive, removing old [timeout=time] support. |
src/.../ngx_http_keyval_module.c , src/.../ngx_stream_keyval_module.c |
Changed the keyval_zone directive from NGX_CONF_TAKE1 to NGX_CONF_1MORE . |
src/ngx_keyval.c , src/ngx_keyval.h |
Introduced TTL and timeout handling for key-value pairs, including new structures and functions for managing timeout events. |
t/keyval.t , t/stream.t |
Added tests for TTL and timeout configurations in key-value and stream server setups. |
🐰✨
In the land of code, where the key-values play,
A rabbit hopped in, changing the day.
"Let's add some time," it said with a cheer,
"To make old data, simply disappear!"
Now keys live and die, by the clock they abide,
Thanks to the rabbit, our storage is spry!
🌟🐇
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
timeout
parameter for key-value pairs, allowing users to set a time-to-live (TTL) for data in thekeyval_zone
directive.keyval_zone
directive to accept one or more parameters, enhancing flexibility in configuration.[timeout=time]
option from thekeyval_zone
directive to align with new timeout handling./get
and/set
endpoints and stream server configurations.