Skip to content

Commit

Permalink
fix: fix slot interval time
Browse files Browse the repository at this point in the history
  • Loading branch information
rickimoore committed May 13, 2024
1 parent f42db2c commit 1f1967f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backend/src/beacon/beacon.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ export class BeaconService {

async fetchSyncData() {
try {
return await this.utilsService.fetchFromCache('syncData', await this.utilsService.getSlotInterval(), async () => {
const slotInterval = await this.utilsService.getSlotInterval()
return await this.utilsService.fetchFromCache('syncData', slotInterval, async () => {
const [ beaconResponse, executionResponse] = await Promise.all(
[
this.utilsService.sendHttpRequest({
Expand Down Expand Up @@ -82,7 +83,7 @@ export class BeaconService {
headSlot: Number(head_slot),
slotDistance: distance,
beaconPercentage: getPercentage(head_slot, distance),
beaconSyncTime: Number(sync_distance) * Number(SECONDS_PER_SLOT),
beaconSyncTime: Number(sync_distance) * (slotInterval / 1000),
syncDistance: Number(sync_distance),
isSyncing: is_syncing,
},
Expand Down

0 comments on commit 1f1967f

Please sign in to comment.