Write a recursive javascript function that retries a request 3 times before it resolves the promise. Do not use await