better redis wait logic