@forgecharts/sdk 1.5.61 → 1.5.63

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/internal.js CHANGED
@@ -10507,14 +10507,29 @@ var DatafeedConnector = class {
10507
10507
  const tfSec = tfSeconds(timeframe);
10508
10508
  let lastSeenBarTime = lastBarTime ?? 0;
10509
10509
  let repairTimer = null;
10510
+ const REPAIR_RETRY_MS = 6e4;
10511
+ const REPAIR_MAX_ATTEMPTS = 15;
10512
+ let repairAttempts = 0;
10510
10513
  const repairGap = (fromTime, toTime) => {
10511
10514
  if (repairTimer) clearTimeout(repairTimer);
10512
10515
  repairTimer = setTimeout(() => {
10513
10516
  repairTimer = null;
10514
10517
  if (this._activeUID !== uid || this._destroyed) return;
10515
10518
  void this._datafeed.getHistoricalBars(symbol, timeframe, fromTime, toTime).then(({ bars: filled }) => {
10516
- if (this._activeUID !== uid || filled.length === 0) return;
10517
- engine.backfillGap(filled);
10519
+ if (this._activeUID !== uid) return;
10520
+ if (filled.length > 0) engine.backfillGap(filled);
10521
+ const newest = filled.length > 0 ? filled[filled.length - 1].time : 0;
10522
+ const covered = tfSec > 0 && newest >= toTime - 2 * tfSec;
10523
+ if (!covered && repairAttempts < REPAIR_MAX_ATTEMPTS) {
10524
+ repairAttempts += 1;
10525
+ if (repairTimer) clearTimeout(repairTimer);
10526
+ repairTimer = setTimeout(() => {
10527
+ repairTimer = null;
10528
+ repairGap(fromTime, toTime);
10529
+ }, REPAIR_RETRY_MS);
10530
+ } else if (covered) {
10531
+ repairAttempts = 0;
10532
+ }
10518
10533
  }).catch(() => {
10519
10534
  });
10520
10535
  }, LIVE_GAP_REPAIR_DELAY_MS);
@@ -25570,7 +25585,7 @@ var demonstrationTool = {
25570
25585
  };
25571
25586
 
25572
25587
  // src/version.ts
25573
- var FORGECHARTS_VERSION = "1.5.61" ;
25588
+ var FORGECHARTS_VERSION = "1.5.63" ;
25574
25589
 
25575
25590
  // src/compatibility.ts
25576
25591
  var MIN_KIT_API = 1;