import { printDiagnosticsToConsole } from "../common/output.js";
import settings from "../common/settings.js";
function wait(duration = settings.POLL_INTERVAL) {
    return new Promise((resolve) => setTimeout(resolve, duration));
}
export async function pingDeployment(argv) {
    for (let pollRetry = 0; pollRetry < settings.MAX_POLL_RETRIES; pollRetry++) {
        printDiagnosticsToConsole(`Waiting for Zuplo deployment to be deleted... (${pollRetry}/${settings.MAX_POLL_RETRIES})`);
        const response = await fetch(`${argv.url}/__zuplo/build`);
        if (!response.ok) {
            return true;
        }
        else {
            await wait();
        }
    }
    return false;
}
//# sourceMappingURL=poll-deployment.js.map