fullcourtdefense-cli 1.18.10 → 1.18.11
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.
- package/dist/selfUpdate.js +12 -3
- package/dist/version.json +1 -1
- package/package.json +1 -1
package/dist/selfUpdate.js
CHANGED
|
@@ -170,7 +170,11 @@ function startMsiSelfUpdate(targetVersion, log) {
|
|
|
170
170
|
};
|
|
171
171
|
}
|
|
172
172
|
let updateInFlightSince = 0;
|
|
173
|
-
|
|
173
|
+
let updateInFlightTarget;
|
|
174
|
+
// A normal MSI finishes in ~5 minutes. Ten minutes avoids duplicate kicks
|
|
175
|
+
// during a healthy install without stranding a machine for an hour after a
|
|
176
|
+
// failed/stalled task.
|
|
177
|
+
const UPDATE_RETRY_COOLDOWN_MS = 10 * 60_000;
|
|
174
178
|
/**
|
|
175
179
|
* Upgrade this machine to targetVersion if it is newer than currentVersion.
|
|
176
180
|
* Cheap no-op when already current, when a kick is still pending, or when the
|
|
@@ -184,9 +188,14 @@ function maybeSelfUpdate(input) {
|
|
|
184
188
|
return undefined;
|
|
185
189
|
if (compareCliVersions(input.targetVersion, input.currentVersion) <= 0)
|
|
186
190
|
return undefined;
|
|
187
|
-
|
|
191
|
+
// A NEW target always gets an immediate attempt. The old global cooldown
|
|
192
|
+
// incorrectly suppressed 1.18.10 after a failed 1.18.9 task.
|
|
193
|
+
if (!input.force
|
|
194
|
+
&& input.targetVersion === updateInFlightTarget
|
|
195
|
+
&& Date.now() - updateInFlightSince < UPDATE_RETRY_COOLDOWN_MS)
|
|
188
196
|
return undefined;
|
|
189
197
|
updateInFlightSince = Date.now();
|
|
198
|
+
updateInFlightTarget = input.targetVersion;
|
|
190
199
|
log(`Self-update: CLI ${input.currentVersion || 'unknown'} -> ${input.targetVersion} (org auto-update).`);
|
|
191
200
|
const kind = detectInstallKind();
|
|
192
201
|
const result = kind === 'msi'
|
|
@@ -195,7 +204,7 @@ function maybeSelfUpdate(input) {
|
|
|
195
204
|
if (!result.started) {
|
|
196
205
|
// Allow another attempt on the next tick after a shorter cooldown when we
|
|
197
206
|
// never managed to start anything.
|
|
198
|
-
updateInFlightSince = Date.now() - UPDATE_RETRY_COOLDOWN_MS +
|
|
207
|
+
updateInFlightSince = Date.now() - UPDATE_RETRY_COOLDOWN_MS + 60_000;
|
|
199
208
|
}
|
|
200
209
|
return result;
|
|
201
210
|
}
|
package/dist/version.json
CHANGED