apnsagent
apnsagent copied to clipboard
Tail recursion in redis subscriber message comsuming
Hi,
When browsing the codes, I notice that there is a tail recursion in file notification.py, line 236. Python is not optimized on tail recursion, unlike most functional programming languages such as lisp or erlang. It could cause memory dilation or even program crash.
hey bro! thanks for your review. Indeed, tail recursion is not the best way to handle the connection error here. But fortunately, the tail recursion is only execute when redis connection error occur, and the recursion time is limited by the variable 'retry_time_max'. Any way, I will refactor it, may be in another language, Thank you and sorry for my tardy reply :)