feat(server): add OXICLOUD_REUSE_PORT env parameter (false by default)
initially server was accepting multiple instances on same port (Linux and MacOS only)
this can create issues during development (if a dev forget another running instance...)
Add OXICLOUD_REUSE_PORT variable to activate it, so only admins knowing this feature can activate itt
(permits multiple instance + let the OS schedduler to decide which process will handle a request)
if not enabled, other instance will receive exit with a:
`Error: Os { code: 48, kind: AddrInUse, message: "Address already in use" }`
This commit is contained in:
@@ -34,6 +34,14 @@ OXICLOUD_SERVER_HOST=127.0.0.1
|
||||
# Maximum upload size in bytes (default: 10 GB on 64-bit)
|
||||
#OXICLOUD_MAX_UPLOAD_SIZE=10737418240
|
||||
|
||||
# Allow multiple processes to bind to the same port (SO_REUSEPORT).
|
||||
# DISABLED by default — leaving this off means a second accidental instance
|
||||
# will fail immediately with "address already in use", which is the safe behaviour.
|
||||
# Enable ONLY when you deliberately run several worker processes in parallel
|
||||
# (e.g. behind a process supervisor or during a zero-downtime rolling restart).
|
||||
# Not supported on Windows.
|
||||
#OXICLOUD_REUSE_PORT=false
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# DATABASE CONFIGURATION
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user