openvibers/openvibe.media Commits

retire-r2.js reads Media's start time in microseconds: systemctl's default whole seconds put a restart made in the same second as the gates before them, so --execute refused.

OP OpenVibers committed 29 Sept 2026 · ea989e1ea3 · 1 file, +3 −2


Changes

ddiff --git a/scripts/retire-r2.js b/scripts/retire-r2.js
iindex 7821a83..12e2235 100644
---- a/scripts/retire-r2.js
++++ b/scripts/retire-r2.js
@@@ -24,10 +24,11 @@ const crypto = require('crypto');
const GATES_FILE = (dataDir) => path.join(dataDir, 'drills', 'r2-gates-closed-at');
--/** When openvibe-media.service last started (ms), or null when systemd cannot say. */
++/** When openvibe-media.service last started (ms, from systemd's microseconds: whole seconds would put a restart
++ * in the same second as the gates before them), or null when systemd cannot say. */
function mediaStartedAt() {
try {
-- const out = require('child_process').execFileSync('systemctl', ['show', 'openvibe-media.service', '-p', 'ActiveEnterTimestamp', '--value'], { encoding: 'utf8' }).trim();
++ const out = require('child_process').execFileSync('systemctl', ['show', '--timestamp=us+utc', 'openvibe-media.service', '-p', 'ActiveEnterTimestamp', '--value'], { encoding: 'utf8' }).trim();
const t = Date.parse(out);
return Number.isFinite(t) ? t : null;
} catch { return null; }