openvibers/openvibe.run Commits
Listen on the socket systemd hands over, so a restart never answers 502 (#123)
Changes
@@@ -53,7 +53,10 @@ async function main() {}let accountSubscription = null;-- const server = app.listen(config.port, config.host, () => {++ // Socket activation (2026-10-31): systemd's .socket unit holds the listener across restarts, so a deploy++ // queues requests in the kernel instead of answering 502. Without the socket unit, the usual listen.++ const socketActivated = process.env.LISTEN_FDS === '1' && Number(process.env.LISTEN_PID) === process.pid;++ const server = app.listen(...(socketActivated ? [{ fd: 3 }] : [config.port, config.host]), () => {console.log(`[Run] ${config.nodeEnv} on http://${config.host}:${config.port} → ${config.baseUrl} (store ${db.store}; valkey ${valkey ? 'on' : 'off: this process only'})`);if (config.events.secret.length >= 32 && config.events.url) {accountSubscription = startSubscriptions({
@@ -53,7 +53,10 @@ async function main() {
@@ -53,7 +53,10 @@ async function main() {
}
}
let accountSubscription = null;
let accountSubscription = null;
- const server = app.listen(config.port, config.host, () => {
+ // Socket activation (2026-10-31): systemd's .socket unit holds the listener across restarts, so a deploy
+ // queues requests in the kernel instead of answering 502. Without the socket unit, the usual listen.
+ const socketActivated = process.env.LISTEN_FDS === '1' && Number(process.env.LISTEN_PID) === process.pid;
+ const server = app.listen(...(socketActivated ? [{ fd: 3 }] : [config.port, config.host]), () => {
console.log(`[Run] ${config.nodeEnv} on http://${config.host}:${config.port} → ${config.baseUrl} (store ${db.store}; valkey ${valkey ? 'on' : 'off: this process only'})`);
console.log(`[Run] ${config.nodeEnv} on http://${config.host}:${config.port} → ${config.baseUrl} (store ${db.store}; valkey ${valkey ? 'on' : 'off: this process only'})`);
if (config.events.secret.length >= 32 && config.events.url) {
if (config.events.secret.length >= 32 && config.events.url) {
accountSubscription = startSubscriptions({
accountSubscription = startSubscriptions({