CodeIgniter Forums
redis driver _get_lock set lock_key problem - Printable Version

+- CodeIgniter Forums (
+-- Forum: Development (
+--- Forum: Issues (
+--- Thread: redis driver _get_lock set lock_key problem (/showthread.php?tid=69129)

Pages: 1 2

RE: redis driver _get_lock set lock_key problem - spjonez - 09-12-2018

(09-12-2018, 09:02 AM)jimpannell Wrote:
   'read_and_close' => true,

Is that something to try or am I completely on the wrong track?

If you never intend on writing any session data that would work. Chances are that's not what you want. For the route that you're pinging every 1s go to the controller method and add session_write_close(); after the last session write. Reads can be below this but no other writes can be. That will free the lock before execution ends once all your writes are complete. If that route doesn't write any session data put the close at the very top of the method (assuming you're autoloading the session driver). Generally you're going to want to manually close the session everywhere once writes are done especially in routes you AJAX to.

This is noted in the users guide: