moved function redis lock to decorator