Closed ozanmuyes closed 7 years ago
Hi!
I just added a note to the README advising users to be weary of the lua_code_cache
directive in 2718b295f97b4a3739297a9cae8eebf00bf7bc2b to avoid such confusion going forward. Thanks for sharing your experience!
Hi @thibaultcha, thanks for the awesome library.
In the development environment I turn off the Lua cache via
lua_code_cache off;
directive in the NGINX/OpenResty configuration file. I followed the documentation add theinit_worker_by_lua_block
block and then use the library to generate UUID v4. I am seeding the generator once in theinit_worker_by_lua_block
block but if I calluuid()
function once (of courselocal uuid = require "resty.jit-uuid"
) it returns the same UUID for every time. It doesn't matter if I restart the server or increaseworker_processes
count, the sequence still the same.Then I realised the Lua code caching is off. Once turned on UUIDs are random. I just wanted to put it here to heads-up for future users (including myself though). At the end of the day we all know one missing semi-colon may be the cause of all hair-pulling.
Greetings.