fix: (regression beta) https initialized twice
Massimo Melina committed
Dec 6, 2024 at 22:57 UTC
fef388487094ad85637501613be40669859bfe5c
1 file changed
+1
-2
src/listen.ts
+1
-2
@@ -143,7 +143,7 @@ const considerHttps = debounceAsync(async () => {
143
events.emit('httpsReady')
144
defaultBaseUrl.proto = 'https'
145
defaultBaseUrl.port = getCurrentPort(httpsSrv) ?? 0
146
-})
146
+}, { wait: 200 }) // give time to have key and cert ready
147
148
149
export const cert = defineConfig('cert', '')
@@ -163,7 +163,6 @@ for (const cfg of httpsNeeds) {
163
httpsOptions[k] = ''
164
unwatch = watchLoad(v, async data => {
165
httpsOptions[k] = data
166
- await wait(500) // when a file is written, give some time for the other to be ready
166
await considerHttps()
167
}, { immediateFirst: true }).unwatch
168
await considerHttps()