Feat : qoder provider

This commit is contained in:
Simon Shi
2026-05-29 16:39:10 +07:00
committed by decolua
parent 53c0eefa00
commit 4baaa5c7aa
6 changed files with 27 additions and 11 deletions

View File

@@ -374,6 +374,14 @@ export async function spawnQuickTunnel(localPort, onUrlUpdate) {
child.on("exit", (code, signal) => {
cloudflaredProcess = null;
clearPid();
// Deliberate kill (restart/disable) — exit silently, no error noise
if (intentionalKill) {
intentionalKill = false;
clearTimeout(timeout);
cleanup();
if (!resolved) { resolved = true; reject(new Error("cloudflared killed")); }
return;
}
console.log(`[Tunnel] cloudflared exit code=${code} signal=${signal}`);
if (!resolved) {
resolved = true;
@@ -389,7 +397,6 @@ export async function spawnQuickTunnel(localPort, onUrlUpdate) {
}
return;
}
if (intentionalKill) { intentionalKill = false; cleanup(); return; }
if (unexpectedExitHandler) unexpectedExitHandler();
cleanup();
});

View File

@@ -100,7 +100,10 @@ export async function enableTunnel(localPort = 20128) {
console.log("[Tunnel] enable success");
return { success: true, tunnelUrl, shortId, publicUrl };
} catch (e) {
console.error(`[Tunnel] enable error: ${e.message}`);
// Suppress noise when spawn was deliberately killed (restart/disable superseded it)
if (!/cloudflared killed|tunnel cancelled/.test(e.message)) {
console.error(`[Tunnel] enable error: ${e.message}`);
}
throw e;
} finally {
svc.spawnInProgress = false;

View File

@@ -27,6 +27,7 @@ export {
export {
isTailscaleInstalled,
isTailscaleRunning,
isTailscaleRunningStrict,
isTailscaleLoggedIn,
installTailscale,
startLogin,