Function retryTask

Keeps trying to run task.

const task = (attempts) => {
// attempts is number of times it has been retried

if (Math.random() > 0.5) {
// Return a succesful result
return { success: true }
} else {
}

}
const t = await retryTask(task, opts);