Fixed race condition setting redis db