Hello!
On Thu, Oct 2, 2014 at 1:40 PM, Matthieu Labour wrote:
> Is there a way to persist lua_shared_dict between restart?
>
The data in shm only persists across HUP reload, not a full restart.
If you want disk-based persistency, then you need to implement that
yourself. For example, initiating a re-occurring timer in
init_worker_by_lua, and flush the shdict contents to a disk file
periodically. This way you won't lose any data unless workers crash
(which is an abnormal event anyway and should be fixed). To prevent
multiple workers writing to the same file at the same time, you need
to use something like the lua-resty-lock library to protect it.
Regards,
-agentzh