conductor-remote 1.19.0 → 1.19.1
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.
|
@@ -32,6 +32,7 @@ const FLAG_ENV = {
|
|
|
32
32
|
'--token': 'RELAY_TOKEN',
|
|
33
33
|
'--write-strategy': 'WRITE_STRATEGY',
|
|
34
34
|
'--auto-update': 'AUTO_UPDATE',
|
|
35
|
+
'--auto-update-interval': 'AUTO_UPDATE_INTERVAL_MINUTES',
|
|
35
36
|
'--db': 'CONDUCTOR_DB',
|
|
36
37
|
'--workspaces': 'CONDUCTOR_WORKSPACES'
|
|
37
38
|
};
|
|
@@ -134,6 +135,8 @@ function buildPlist() {
|
|
|
134
135
|
envEntries.push(['RELAY_PORT', process.env.RELAY_PORT]);
|
|
135
136
|
if (process.env.AUTO_UPDATE)
|
|
136
137
|
envEntries.push(['AUTO_UPDATE', process.env.AUTO_UPDATE]);
|
|
138
|
+
if (process.env.AUTO_UPDATE_INTERVAL_MINUTES)
|
|
139
|
+
envEntries.push(['AUTO_UPDATE_INTERVAL_MINUTES', process.env.AUTO_UPDATE_INTERVAL_MINUTES]);
|
|
137
140
|
if (process.env.CONDUCTOR_DB)
|
|
138
141
|
envEntries.push(['CONDUCTOR_DB', process.env.CONDUCTOR_DB]);
|
|
139
142
|
if (process.env.CONDUCTOR_WORKSPACES)
|
|
@@ -35,10 +35,20 @@ const execFileP = promisify(execFile);
|
|
|
35
35
|
const NAME = 'conductor-remote';
|
|
36
36
|
const projectDir = packageRoot(import.meta.dirname);
|
|
37
37
|
const REGISTRY = process.env.NPM_REGISTRY ?? 'https://registry.npmjs.org';
|
|
38
|
-
|
|
38
|
+
// Registry poll cadence. The poll is a single cheap GET off npm's CDN, so a tight loop costs nothing;
|
|
39
|
+
// a coarse interval, by contrast, left the phone serving a stale build for hours when several versions
|
|
40
|
+
// ship in quick succession (the poll only fires ~90s after boot, then on this interval). 2 min keeps the
|
|
41
|
+
// phone within a couple minutes of `latest`. `AUTO_UPDATE_INTERVAL_MINUTES` retunes it with no code change;
|
|
42
|
+
// values are floored at 1 min (below that you're just racing the 60s disk-skew heal and the CDN's tag TTL).
|
|
43
|
+
function resolveIntervalMs() {
|
|
44
|
+
const raw = Number(process.env.AUTO_UPDATE_INTERVAL_MINUTES);
|
|
45
|
+
const minutes = Number.isFinite(raw) && raw > 0 ? raw : 2;
|
|
46
|
+
return Math.max(minutes, 1) * 60 * 1000;
|
|
47
|
+
}
|
|
48
|
+
const CHECK_INTERVAL_MS = resolveIntervalMs();
|
|
39
49
|
const FIRST_DELAY_MS = 90 * 1000;
|
|
40
50
|
// A local package.json read is free next to a network poll, so reconcile disk↔process skew often —
|
|
41
|
-
// this heals an out-of-band upgrade in ~a minute instead of waiting
|
|
51
|
+
// this heals an out-of-band upgrade in ~a minute instead of waiting for the next registry poll.
|
|
42
52
|
const DISK_CHECK_INTERVAL_MS = 60 * 1000;
|
|
43
53
|
function readVersion() {
|
|
44
54
|
try {
|
|
@@ -198,7 +208,8 @@ export function startAutoUpdate() {
|
|
|
198
208
|
status.mode = mode;
|
|
199
209
|
if (mode === 'off')
|
|
200
210
|
return;
|
|
201
|
-
|
|
211
|
+
const everyMin = Math.round(CHECK_INTERVAL_MS / 60_000);
|
|
212
|
+
log(`enabled (mode=${mode}, current=${CURRENT}); first check in ${FIRST_DELAY_MS / 1000}s, then every ${everyMin}m.`);
|
|
202
213
|
setTimeout(() => void runCheck(mode), FIRST_DELAY_MS).unref();
|
|
203
214
|
setInterval(() => void runCheck(mode), CHECK_INTERVAL_MS).unref();
|
|
204
215
|
// Only `auto` may exit()→restart (KeepAlive is guaranteed there); `check` reports but never acts,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "conductor-remote",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"packageManager": "yarn@4.15.0",
|
|
6
6
|
"description": "Phone control panel for local Conductor agents. Reads ride SQLite + git; prompts ride Conductor's own dispatch path.",
|