HS Updates

This commit is contained in:
Raven Scott
2026-04-24 08:54:16 -04:00
parent b060f368f4
commit bdf4b02b82
4 changed files with 114 additions and 0 deletions
@@ -78,6 +78,7 @@ export async function ensureBareOsWwwHolesailTunnel(ctx, env, port) {
/** @type {Record<string, unknown>} */
const want = { server: true, port: p, host: wantHost, enabled: true }
const existing = state.connections[id]
let shouldRestartRuntime = false
if (existing && typeof existing === 'object') {
const ex = /** @type {Record<string, unknown>} */ (existing)
const curPort = Number.parseInt(String(ex.port ?? ''), 10)
@@ -88,6 +89,7 @@ export async function ensureBareOsWwwHolesailTunnel(ctx, env, port) {
: bareHolesailEnvTruthy(ex.enabled)
const rawHost = String(ex.host ?? '').trim()
const hostOk = rawHost === wantHost
shouldRestartRuntime = !(curPort === p && hostOk && server && enabled)
if (server && curPort === p && enabled && hostOk) {
await bareHolesailManagedEnsureServerSeedPersisted(
ctx,
@@ -139,6 +141,13 @@ export async function ensureBareOsWwwHolesailTunnel(ctx, env, port) {
id
)
void path
if (shouldRestartRuntime && bareHolesailManagedRuntimeRunning(id)) {
try {
await bareHolesailManagedStopOne(ctx, id)
} catch {
/* ignore */
}
}
for (const staleId of staleIds) {
if (bareHolesailManagedRuntimeRunning(staleId)) {
try {