fix case-when-end block for redis adapter