usebeeline 0.1.115 → 0.1.117
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/usebeeline.mjs +14 -4
- package/package.json +1 -1
package/dist/usebeeline.mjs
CHANGED
|
@@ -1150,14 +1150,15 @@ async function prepareReleaseInWorker(env, deadlineAt, entrypoint) {
|
|
|
1150
1150
|
});
|
|
1151
1151
|
});
|
|
1152
1152
|
}
|
|
1153
|
-
var UPDATE_CONVERGENCE_SLO_MS, UPDATE_DRAIN_DEADLINE_MS, UPDATE_PREPARE_DEADLINE_MS, ReleaseTransaction;
|
|
1153
|
+
var UPDATE_CONVERGENCE_SLO_MS, UPDATE_DRAIN_DEADLINE_MS, UPDATE_INTERRUPT_DEADLINE_MS, UPDATE_PREPARE_DEADLINE_MS, ReleaseTransaction;
|
|
1154
1154
|
var init_managed_update = __esm({
|
|
1155
1155
|
"apps/body/dist/managed-update.js"() {
|
|
1156
1156
|
"use strict";
|
|
1157
1157
|
init_kernel_lock();
|
|
1158
1158
|
init_self_update();
|
|
1159
|
-
UPDATE_CONVERGENCE_SLO_MS =
|
|
1159
|
+
UPDATE_CONVERGENCE_SLO_MS = 20 * 6e4;
|
|
1160
1160
|
UPDATE_DRAIN_DEADLINE_MS = 5 * 6e4;
|
|
1161
|
+
UPDATE_INTERRUPT_DEADLINE_MS = 15 * 6e4;
|
|
1161
1162
|
UPDATE_PREPARE_DEADLINE_MS = 3 * 6e4;
|
|
1162
1163
|
ReleaseTransaction = class {
|
|
1163
1164
|
options;
|
|
@@ -1166,6 +1167,7 @@ var init_managed_update = __esm({
|
|
|
1166
1167
|
#prepared;
|
|
1167
1168
|
#minimum;
|
|
1168
1169
|
#handoffAt;
|
|
1170
|
+
#interruptAt;
|
|
1169
1171
|
#deadlineAt;
|
|
1170
1172
|
#timer;
|
|
1171
1173
|
#handingOff;
|
|
@@ -1215,6 +1217,7 @@ var init_managed_update = __esm({
|
|
|
1215
1217
|
this.#prepared = void 0;
|
|
1216
1218
|
this.#deadlineAt = void 0;
|
|
1217
1219
|
this.#handoffAt = void 0;
|
|
1220
|
+
this.#interruptAt = void 0;
|
|
1218
1221
|
this.#draining = false;
|
|
1219
1222
|
clearTimeout(this.#timer);
|
|
1220
1223
|
this.#timer = void 0;
|
|
@@ -1224,6 +1227,7 @@ var init_managed_update = __esm({
|
|
|
1224
1227
|
this.#prepared = releaseId;
|
|
1225
1228
|
this.#deadlineAt ??= this.now() + UPDATE_CONVERGENCE_SLO_MS;
|
|
1226
1229
|
this.#handoffAt ??= Math.min(this.now() + (this.options.drainMs ?? UPDATE_DRAIN_DEADLINE_MS), this.#deadlineAt - 12e4);
|
|
1230
|
+
this.#interruptAt ??= this.now() + UPDATE_INTERRUPT_DEADLINE_MS;
|
|
1227
1231
|
this.options.changed(releaseId);
|
|
1228
1232
|
if (!this.#timer)
|
|
1229
1233
|
this.#timer = setTimeout(() => {
|
|
@@ -1235,8 +1239,9 @@ var init_managed_update = __esm({
|
|
|
1235
1239
|
async idleChanged() {
|
|
1236
1240
|
if (this.#completed || !this.#prepared || this.#preparing || this.#pendingCheck || this.#handingOff)
|
|
1237
1241
|
return;
|
|
1238
|
-
const
|
|
1239
|
-
|
|
1242
|
+
const idle = this.options.idle();
|
|
1243
|
+
const interrupted = Boolean(this.#minimum) || !idle && this.now() >= this.#interruptAt;
|
|
1244
|
+
if (!interrupted && !idle) {
|
|
1240
1245
|
if (!this.#draining && this.now() >= this.#handoffAt) {
|
|
1241
1246
|
try {
|
|
1242
1247
|
this.options.drain();
|
|
@@ -1245,6 +1250,11 @@ var init_managed_update = __esm({
|
|
|
1245
1250
|
this.options.failed(error, this.#minimum);
|
|
1246
1251
|
}
|
|
1247
1252
|
}
|
|
1253
|
+
if (!this.#timer && this.now() >= this.#handoffAt)
|
|
1254
|
+
this.#timer = setTimeout(() => {
|
|
1255
|
+
this.#timer = void 0;
|
|
1256
|
+
void this.idleChanged();
|
|
1257
|
+
}, Math.max(0, this.#interruptAt - this.now()));
|
|
1248
1258
|
return;
|
|
1249
1259
|
}
|
|
1250
1260
|
clearTimeout(this.#timer);
|