@jeffusion/bungee 6.19.1 → 6.19.3

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.
Files changed (2) hide show
  1. package/dist/index.js +17 -7
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -18547,10 +18547,11 @@ function parseRelease(value, assetName = getAssetName()) {
18547
18547
  const asset = item?.state === "uploaded" && item.browser_download_url === expectedUrl && Number.isSafeInteger(item.size) && item.size > 0 && item.size <= MAX_ARCHIVE_BYTES && typeof item.digest === "string" && /^sha256:[a-f0-9]{64}$/.test(item.digest) ? { url: expectedUrl, size: item.size, digest: item.digest } : null;
18548
18548
  return { version, published_at: release.published_at, url, asset };
18549
18549
  }
18550
- async function fetchLatestRelease(http = fetch, binaryName = getBinaryName()) {
18550
+ async function fetchLatestRelease(http = fetch, binaryName = getBinaryName(), signal) {
18551
+ const timeout = AbortSignal.timeout(15000);
18551
18552
  const response = await http(RELEASE_API, {
18552
18553
  headers: { Accept: "application/vnd.github+json", "User-Agent": "Bungee-Updates" },
18553
- signal: AbortSignal.timeout(15000),
18554
+ signal: signal ? AbortSignal.any([timeout, signal]) : timeout,
18554
18555
  redirect: "error"
18555
18556
  });
18556
18557
  if (!response.ok)
@@ -18907,6 +18908,7 @@ class UpdateController {
18907
18908
  checkedAt = null;
18908
18909
  checkError = null;
18909
18910
  checking = null;
18911
+ checkAbort = null;
18910
18912
  timer = null;
18911
18913
  store;
18912
18914
  unavailable;
@@ -18955,6 +18957,8 @@ class UpdateController {
18955
18957
  if (this.timer)
18956
18958
  clearInterval(this.timer);
18957
18959
  this.timer = null;
18960
+ this.checkAbort?.abort();
18961
+ this.checkAbort = null;
18958
18962
  }
18959
18963
  cancel() {
18960
18964
  this.stopped = true;
@@ -18969,17 +18973,23 @@ class UpdateController {
18969
18973
  }
18970
18974
  }
18971
18975
  async check() {
18976
+ if (this.stopped)
18977
+ return;
18972
18978
  if (this.checking)
18973
18979
  return this.checking;
18980
+ const controller = new AbortController;
18981
+ this.checkAbort = controller;
18974
18982
  this.checking = (async () => {
18975
18983
  try {
18976
- this.release = await fetchLatestRelease(this.http);
18984
+ this.release = await fetchLatestRelease(this.http, undefined, controller.signal);
18977
18985
  this.checkError = null;
18978
18986
  } catch (error) {
18979
18987
  this.checkError = error instanceof UpdateError ? error.code : "release_check_failed";
18980
18988
  } finally {
18981
18989
  this.checkedAt = Date.now();
18982
18990
  this.checking = null;
18991
+ if (this.checkAbort === controller)
18992
+ this.checkAbort = null;
18983
18993
  }
18984
18994
  })();
18985
18995
  return this.checking;
@@ -20918,7 +20928,7 @@ class DaemonManager {
20918
20928
  metadata = await readDaemonMetadataFile(this.metadataFile, this.fileOptions());
20919
20929
  } catch (error) {
20920
20930
  if (error instanceof DaemonFileError && error.code === "race") {
20921
- await this.sleep(100);
20931
+ await this.sleep(25);
20922
20932
  continue;
20923
20933
  }
20924
20934
  throw new Error(`Daemon startup metadata is unavailable: ${errorText(error)}`);
@@ -20959,7 +20969,7 @@ class DaemonManager {
20959
20969
  } else {
20960
20970
  throw new Error(`Daemon metadata entered illegal state: ${metadata.state}`);
20961
20971
  }
20962
- await this.sleep(100);
20972
+ await this.sleep(25);
20963
20973
  }
20964
20974
  throw new Error(`Daemon did not become armed within ${this.startTimeoutMs / 1000} seconds; metadata retained`);
20965
20975
  }
@@ -21221,7 +21231,7 @@ class DaemonManager {
21221
21231
  return;
21222
21232
  throw this.ownerGoneFailure(owner);
21223
21233
  }
21224
- await this.sleep(50);
21234
+ await this.sleep(25);
21225
21235
  }
21226
21236
  throw new Error("Forced daemon stop did not prove process exit");
21227
21237
  }
@@ -21829,7 +21839,7 @@ async function importCommand(options) {
21829
21839
  // package.json
21830
21840
  var package_default = {
21831
21841
  name: "@jeffusion/bungee",
21832
- version: "6.19.1",
21842
+ version: "6.19.3",
21833
21843
  description: "High-performance reverse proxy server CLI",
21834
21844
  type: "module",
21835
21845
  bin: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jeffusion/bungee",
3
- "version": "6.19.1",
3
+ "version": "6.19.3",
4
4
  "description": "High-performance reverse proxy server CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -13,8 +13,8 @@
13
13
  "test": "bun test"
14
14
  },
15
15
  "dependencies": {
16
- "@jeffusion/bungee-core": "^6.19.1",
17
- "@jeffusion/bungee-types": "^6.19.1",
16
+ "@jeffusion/bungee-core": "^6.19.3",
17
+ "@jeffusion/bungee-types": "^6.19.3",
18
18
  "cli-progress": "^3.12.0",
19
19
  "commander": "^14.0.1"
20
20
  },