lua-resty-redis
lua-resty-redis copied to clipboard
What will occur if not close redis?
trafficstars
Hello!
I have long transaction with redis: set some keys with testing ok/not_ok status; get keys and test results; then rpush, test result; then inner calcs; then another set and so on. After every operation I test success/error of this one. If error I return from function. If All OK I finish my transaction, exec() and close() redis. But in case of error and return I never call close()[keep_alive] redis. Is it correct? This redis connection is still open and allocate extra resource? Is there some appropriate technics for centralized closing redis in case of errors? something like: try {} catch {close_redis(); ....} ?
Thanks