hiredis
hiredis copied to clipboard
onDisconnect won't fire if REDIS_NO_AUTO_FREE is set
Now that there is a flag for allowing the client to clean up the redis async context (thank you for that!) I noticed that if REDIS_NO_AUTO_FREE
is set then onDisconnect
callback won't be triggered. Is this by design? I would assume any code calling __redisAsyncDisconnect
should still trigger onDisconnect
callbacks and that REDIS_NO_AUTO_FREE
would only govern the freeing aspect.
I know historically redisAsyncFree
also disconnects so I'm not sure exactly what a fix here would look like but I could give it a shot if it's desired 👍
I didn't add the REDIS_NO_AUTO_FREE
flag so I'm not totally clear on the use case but are you just looking for onDisconnect
and perhaps any set dataCleanup
callback to still be triggered?
Yes. If you set the REDIS_NO_AUTO_FREE
flag then onDisconnect
won't fire. I was going to look at committing a fix for people to look at but never got around to it.
I am going through old open issues in preparation for a new release.
Is this what you were looking for?