Преглед изворни кода

backend: fix block-era relation (importEraAtBlock)

Joystream Stats пре 4 година
родитељ
комит
cb5d50d9a6
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      server/joystream/index.ts

+ 2 - 2
server/joystream/index.ts

@@ -230,7 +230,7 @@ const fetchAll = async (api: Api, status: Status) => {
   }
 
   queue.push(() => fetchProposalPosts(api, status.proposalPosts))
-  queue.push(() => addBlockRange(api, 2000000, status.block))
+  queue.push(() => addBlockRange(api, 1, status.block))
   queuedAll = true
   processNext()
 }
@@ -255,8 +255,8 @@ const fetchValidators = async (api: Api, hash: string) =>
 const importEraAtBlock = async (api: Api, blockId: number, hash: string) => {
   const id = await getEraAtHash(api, hash)
   const [era] = await Era.findOrCreate({ where: { id } })
-  if (era.active) return
   era.addBlock(blockId)
+  if (era.active) return
 
   processing = `era ${id}`
   try {