@raytrace-cli/sdk 0.2.1 → 0.2.3
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.
- package/package.json +1 -1
- package/src/index.mjs +6 -6
package/package.json
CHANGED
package/src/index.mjs
CHANGED
|
@@ -58,7 +58,7 @@ export class Sandbox {
|
|
|
58
58
|
{ body: { command, timeout_seconds: timeoutSeconds, request_id: requestId } },
|
|
59
59
|
);
|
|
60
60
|
let job = created;
|
|
61
|
-
while (!TERMINAL_STATES.has(job.state)) {
|
|
61
|
+
while (!TERMINAL_STATES.has(job.state) || job.recovery_pending) {
|
|
62
62
|
await sleep(pollIntervalMs);
|
|
63
63
|
const { data: latest } = await this._client.request(
|
|
64
64
|
'GET',
|
|
@@ -110,12 +110,12 @@ export class Sandbox {
|
|
|
110
110
|
await sleep(pollIntervalMs);
|
|
111
111
|
const { data: list } = await this._client.request('GET', '/v1/sandboxes');
|
|
112
112
|
const current = (list || []).find(item => item.id === this.id);
|
|
113
|
-
if (!current)
|
|
113
|
+
if (!current) throw new RayTraceError(`Sandbox ${this.id} disappeared while restoring`, { status: 404 });
|
|
114
114
|
this.info = current;
|
|
115
|
-
if (current.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
if (current.restore_error) {
|
|
116
|
+
throw new RayTraceError(`Archive restore failed: ${current.restore_error}`, { status: 500, body: current });
|
|
117
|
+
}
|
|
118
|
+
if (!current.restoring && (current.status === 'running' || current.status === 'archived')) {
|
|
119
119
|
break;
|
|
120
120
|
}
|
|
121
121
|
}
|