@shipers-dev/multi 0.23.2 → 0.23.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 +8 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -15000,7 +15000,7 @@ import { parseArgs as parseArgs2 } from "util";
15000
15000
  // package.json
15001
15001
  var package_default = {
15002
15002
  name: "@shipers-dev/multi",
15003
- version: "0.23.2",
15003
+ version: "0.23.3",
15004
15004
  type: "module",
15005
15005
  bin: {
15006
15006
  "multi-agent": "./dist/index.js"
@@ -32695,13 +32695,13 @@ async function cmdConnect(apiUrl, config2) {
32695
32695
  heartbeat().catch(() => {});
32696
32696
  }, 200);
32697
32697
  };
32698
+ let alive = true;
32698
32699
  {
32699
32700
  const pending3 = await heartbeat();
32700
32701
  if (pending3 > 0)
32701
32702
  drainOfflineDispatches(apiUrl, config2.deviceId, config2.token, db, () => schedule2(), () => alive);
32702
32703
  }
32703
32704
  drainOfflineDispatches(apiUrl, config2.deviceId, config2.token, db, () => schedule2(), () => alive);
32704
- let alive = true;
32705
32705
  const shutdown = async (reason) => {
32706
32706
  if (!alive)
32707
32707
  return;
@@ -32780,9 +32780,9 @@ async function cmdConnect(apiUrl, config2) {
32780
32780
  })();
32781
32781
  let probeFailures = 0;
32782
32782
  let tick = 0;
32783
- const PROBE_EVERY = 6;
32783
+ const PROBE_EVERY = 2;
32784
32784
  while (alive) {
32785
- await sleep5(20000);
32785
+ await sleep5(60000);
32786
32786
  if (existsSync7(STOP_PATH2)) {
32787
32787
  await shutdown("stop flag");
32788
32788
  break;
@@ -34374,7 +34374,10 @@ function loadConfig() {
34374
34374
  try {
34375
34375
  if (!existsSync7(CONFIG_PATH2))
34376
34376
  return {};
34377
- return JSON.parse(readFileSync7(CONFIG_PATH2, "utf8"));
34377
+ const raw = JSON.parse(readFileSync7(CONFIG_PATH2, "utf8"));
34378
+ if (!raw.token && raw.authToken)
34379
+ raw.token = raw.authToken;
34380
+ return raw;
34378
34381
  } catch {
34379
34382
  return {};
34380
34383
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipers-dev/multi",
3
- "version": "0.23.2",
3
+ "version": "0.23.3",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "multi-agent": "./dist/index.js"