tradeblocks-mcp 2.2.4 → 2.2.5

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.
@@ -807,14 +807,18 @@ async function getConnection(dataDir) {
807
807
  if (isLockError(errorMessage)) {
808
808
  const recovered = await tryRecoverLockByTerminatingStaleProcess(errorMessage, dbPath, forceRecovery);
809
809
  if (recovered) {
810
- try {
811
- return await openReadWriteConnection(dbPath, threads, memoryLimit);
812
- } catch (recoveryError) {
813
- resetConnectionState();
814
- const recoveryMessage = recoveryError instanceof Error ? recoveryError.message : String(recoveryError);
815
- throw new Error(
816
- `Failed to initialize DuckDB at ${dbPath} after lock recovery: ${recoveryMessage}`
817
- );
810
+ for (let attempt = 0; attempt < 3; attempt++) {
811
+ await new Promise((r) => setTimeout(r, 500 * (attempt + 1)));
812
+ try {
813
+ return await openReadWriteConnection(dbPath, threads, memoryLimit);
814
+ } catch (retryError) {
815
+ const retryMsg = retryError instanceof Error ? retryError.message : String(retryError);
816
+ if (attempt < 2 && isLockError(retryMsg)) continue;
817
+ resetConnectionState();
818
+ throw new Error(
819
+ `Failed to initialize DuckDB at ${dbPath} after lock recovery: ${retryMsg}`
820
+ );
821
+ }
818
822
  }
819
823
  }
820
824
  }
@@ -857,8 +861,8 @@ async function closeConnection() {
857
861
  async function upgradeToReadWrite(dataDir, options) {
858
862
  if (connectionMode === "read_write" && connection) return connection;
859
863
  await closeConnection();
860
- const maxRetries = 2;
861
- const retryDelayMs = 500;
864
+ const maxRetries = 4;
865
+ const retryDelayMs = 1e3;
862
866
  let lastError = null;
863
867
  for (let attempt = 0; attempt <= maxRetries; attempt++) {
864
868
  try {
@@ -22770,4 +22774,4 @@ decimal.js/decimal.mjs:
22770
22774
  * MIT Licence
22771
22775
  *)
22772
22776
  */
22773
- //# sourceMappingURL=chunk-O6FQQRJV.js.map
22777
+ //# sourceMappingURL=chunk-UGHXXLLR.js.map