hiredis icon indicating copy to clipboard operation
hiredis copied to clipboard

onDisconnect won't fire if REDIS_NO_AUTO_FREE is set

Open KrisSiegel opened this issue 4 years ago • 3 comments

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 👍

KrisSiegel avatar Sep 19 '19 01:09 KrisSiegel

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?

michael-grunder avatar Jul 10 '20 17:07 michael-grunder

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.

KrisSiegel avatar Jul 12 '20 02:07 KrisSiegel

I am going through old open issues in preparation for a new release.

Is this what you were looking for?

michael-grunder avatar Sep 08 '22 02:09 michael-grunder