@rip-lang/server 0.5.4 → 0.5.6

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 (2) hide show
  1. package/package.json +1 -1
  2. package/server.rip +10 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rip-lang/server",
3
- "version": "0.5.4",
3
+ "version": "0.5.6",
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
@@ -523,7 +523,16 @@ class Manager
523
523
  tracked
524
524
 
525
525
  monitor: (w) ->
526
- w.process.exited
526
+ await w.process.exited # Wait for process to exit
527
+
528
+ # Notify server to remove dead worker's socket entry
529
+ try
530
+ ctl = getControlSocketPath(@flags.socketPrefix)
531
+ body = JSON.stringify({ op: 'quit', workerId: w.id })
532
+ await fetch('http://localhost/worker', { method: 'POST', body, headers: { 'content-type': 'application/json' }, unix: ctl })
533
+ catch
534
+ null
535
+
527
536
  return if @shuttingDown
528
537
  return if @retiringIds.has(w.id)
529
538
  w.restartCount++