Bläddra i källkod

backend: fix block-era relation (importEraAtBlock)

Joystream Stats 4 år sedan
förälder
incheckning
cb5d50d9a6
1 ändrade filer med 2 tillägg och 2 borttagningar
  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 {