nexrall-code 0.5.201 → 0.5.202
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/dist/index.js +18 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -79764,6 +79764,9 @@ function statusColor(status) {
|
|
|
79764
79764
|
}
|
|
79765
79765
|
var TERMINAL = /* @__PURE__ */ new Set(["done", "failed", "stopped"]);
|
|
79766
79766
|
var sleep = (ms) => new Promise((r2) => setTimeout(r2, ms));
|
|
79767
|
+
var writeRaw = (s2) => {
|
|
79768
|
+
process.stdout.write(s2);
|
|
79769
|
+
};
|
|
79767
79770
|
function openUrl(url) {
|
|
79768
79771
|
const cmd = process.platform === "darwin" ? "open" : process.platform === "win32" ? "cmd" : "xdg-open";
|
|
79769
79772
|
const args = process.platform === "win32" ? ["/c", "start", "", url] : [url];
|
|
@@ -79855,12 +79858,25 @@ async function cloudLogsCommand(id, opts) {
|
|
|
79855
79858
|
let prev = "";
|
|
79856
79859
|
let lastStatus = "";
|
|
79857
79860
|
let printedGapNote = false;
|
|
79861
|
+
let consecutiveErrors = 0;
|
|
79862
|
+
const MAX_CONSECUTIVE_ERRORS = 60;
|
|
79858
79863
|
for (; ; ) {
|
|
79859
79864
|
let r2;
|
|
79860
79865
|
try {
|
|
79861
79866
|
r2 = await (0, import_code_core5.getCloudSessionLogs)(id, tail ?? 1e3);
|
|
79867
|
+
consecutiveErrors = 0;
|
|
79862
79868
|
} catch (e2) {
|
|
79863
|
-
|
|
79869
|
+
const msg = errText2(e2);
|
|
79870
|
+
if (/not found/i.test(msg))
|
|
79871
|
+
return fail2(msg);
|
|
79872
|
+
consecutiveErrors++;
|
|
79873
|
+
if (consecutiveErrors === 1)
|
|
79874
|
+
console.log(paint.dim(` Waiting for pod logs\u2026 (${msg})`));
|
|
79875
|
+
if (consecutiveErrors > MAX_CONSECUTIVE_ERRORS) {
|
|
79876
|
+
return fail2(`Gave up after ${consecutiveErrors} failed polls: ${msg}`);
|
|
79877
|
+
}
|
|
79878
|
+
await sleep(2e3);
|
|
79879
|
+
continue;
|
|
79864
79880
|
}
|
|
79865
79881
|
const s2 = r2.session;
|
|
79866
79882
|
if (s2.status !== lastStatus) {
|
|
@@ -79872,7 +79888,7 @@ async function cloudLogsCommand(id, opts) {
|
|
|
79872
79888
|
if (text.length < prev.length)
|
|
79873
79889
|
prev = "";
|
|
79874
79890
|
if (text.length > prev.length) {
|
|
79875
|
-
|
|
79891
|
+
writeRaw(text.slice(prev.length));
|
|
79876
79892
|
prev = text;
|
|
79877
79893
|
}
|
|
79878
79894
|
} else if (TERMINAL.has(s2.status) && !printedGapNote && !prev) {
|