@rip-lang/server 0.8.1 → 0.8.3

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.
Files changed (3) hide show
  1. package/README.md +3 -3
  2. package/package.json +1 -1
  3. package/server.rip +4 -9
package/README.md CHANGED
@@ -424,9 +424,9 @@ Most settings are configured via CLI flags, but environment variables provide an
424
424
  | `RIP_MAX_REQUESTS` | `r:N,...` | `10000` | Max requests before worker recycle |
425
425
  | `RIP_MAX_SECONDS` | `r:...,Ns` | `3600` | Max seconds before worker recycle |
426
426
  | `RIP_MAX_QUEUE` | `--max-queue=` | `512` | Request queue limit |
427
- | `RIP_QUEUE_TIMEOUT_MS` | `--queue-timeout-ms=` | `2000` | Queue wait timeout (ms) |
428
- | `RIP_CONNECT_TIMEOUT_MS` | `--connect-timeout-ms=` | `20000` | Worker request timeout (ms) |
429
- | `RIP_READ_TIMEOUT_MS` | `--read-timeout-ms=` | `5000` | Worker read timeout (ms) |
427
+ | `RIP_QUEUE_TIMEOUT_MS` | `--queue-timeout-ms=` | `30000` | Queue wait timeout (ms) |
428
+ | `RIP_CONNECT_TIMEOUT_MS` | `--connect-timeout-ms=` | `2000` | Reserved for future use |
429
+ | `RIP_READ_TIMEOUT_MS` | `--read-timeout-ms=` | `30000` | Worker read timeout (ms) |
430
430
 
431
431
  ## Dashboard
432
432
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rip-lang/server",
3
- "version": "0.8.1",
3
+ "version": "0.8.3",
4
4
  "description": "Pure Rip application server — multi-worker, hot reload, HTTPS, mDNS",
5
5
  "type": "module",
6
6
  "main": "server.rip",
package/server.rip CHANGED
@@ -340,9 +340,9 @@ parseFlags = (argv) ->
340
340
  reload
341
341
  socketPrefix
342
342
  maxQueue: coerceInt(getKV('--max-queue='), coerceInt(process.env.RIP_MAX_QUEUE, 512))
343
- queueTimeoutMs: coerceInt(getKV('--queue-timeout-ms='), coerceInt(process.env.RIP_QUEUE_TIMEOUT_MS, 2000))
344
- connectTimeoutMs: coerceInt(getKV('--connect-timeout-ms='), coerceInt(process.env.RIP_CONNECT_TIMEOUT_MS, 20000))
345
- readTimeoutMs: coerceInt(getKV('--read-timeout-ms='), coerceInt(process.env.RIP_READ_TIMEOUT_MS, 5000))
343
+ queueTimeoutMs: coerceInt(getKV('--queue-timeout-ms='), coerceInt(process.env.RIP_QUEUE_TIMEOUT_MS, 30000))
344
+ connectTimeoutMs: coerceInt(getKV('--connect-timeout-ms='), coerceInt(process.env.RIP_CONNECT_TIMEOUT_MS, 2000))
345
+ readTimeoutMs: coerceInt(getKV('--read-timeout-ms='), coerceInt(process.env.RIP_READ_TIMEOUT_MS, 30000))
346
346
  jsonLogging: has('--json-logging')
347
347
  accessLog: not has('--no-access-log')
348
348
  watchGlob: watchGlob
@@ -876,20 +876,15 @@ class Server
876
876
  forwardOnce: (req, socketPath) ->
877
877
  inUrl = new URL(req.url)
878
878
  forwardUrl = "http://localhost#{inUrl.pathname}#{inUrl.search}"
879
- controller = new AbortController()
880
- connectTimer = setTimeout (-> controller.abort()), @flags.connectTimeoutMs
881
879
  readTimeoutMs = @flags.readTimeoutMs
882
880
 
883
881
  try
884
- # Don't await fetch - we need to race the promise against timeout
885
- fetchPromise = fetch(forwardUrl, { method: req.method, headers: req.headers, body: req.body, unix: socketPath, signal: controller.signal })
882
+ fetchPromise = fetch(forwardUrl, { method: req.method, headers: req.headers, body: req.body, unix: socketPath })
886
883
  readGuard = new Promise (_, rej) ->
887
884
  setTimeout (-> rej(new Error('Upstream timeout'))), readTimeoutMs
888
885
  res = Promise.race!([fetchPromise, readGuard])
889
- clearTimeout(connectTimer)
890
886
  res
891
887
  catch err
892
- clearTimeout(connectTimer)
893
888
  if err.message is 'Upstream timeout'
894
889
  return new Response('Gateway timeout', { status: 504 })
895
890
  throw err