@zuplo/cli 1.21.0 → 1.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,6 +5,8 @@ function wait(duration = settings.POLL_INTERVAL) {
5
5
  return new Promise((resolve) => setTimeout(resolve, duration));
6
6
  }
7
7
  export async function pollDeployment(argv, fileId, account, project) {
8
+ const MAX_RETRY_ATTEMPTS_FOR_SERVER_UPDATES = 5;
9
+ let CURRENT_RETRY_ATTEMPTS_FOR_SERVER_UPDATES = 0;
8
10
  for (let pollRetry = 0; pollRetry < settings.MAX_POLL_RETRIES; pollRetry++) {
9
11
  printDiagnosticsToConsole(`Polling for deployment status... (${pollRetry}/${settings.MAX_POLL_RETRIES})`);
10
12
  const response = await fetch(`${settings.ZUPLO_DEVELOPER_API_ENDPOINT}/v1/accounts/${account}/projects/${project}/deployment-status/${fileId}`, {
@@ -41,6 +43,13 @@ export async function pollDeployment(argv, fileId, account, project) {
41
43
  await wait();
42
44
  continue;
43
45
  }
46
+ else if (response.status === 500 &&
47
+ CURRENT_RETRY_ATTEMPTS_FOR_SERVER_UPDATES <
48
+ MAX_RETRY_ATTEMPTS_FOR_SERVER_UPDATES) {
49
+ CURRENT_RETRY_ATTEMPTS_FOR_SERVER_UPDATES++;
50
+ await wait();
51
+ continue;
52
+ }
44
53
  else {
45
54
  logger.error(`Unexpected error from server while polling for deployment: ${response.status} ${response.statusText} ${await response.text()}`);
46
55
  throw new Error(`Unexpected response from server while polling for deployment: ${response.status} ${response.statusText}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuplo/cli",
3
- "version": "1.21.0",
3
+ "version": "1.22.0",
4
4
  "type": "module",
5
5
  "repository": "https://github.com/zuplo/cli",
6
6
  "author": "Zuplo, Inc.",