HS Updates
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user