Comparing version 5.0.2-528 to 5.0.2-533
@@ -14,3 +14,5 @@ /// <reference types="bunyan" /> | ||
lastProcessedBlockHash: string; | ||
lastIrreversibleBlockNumber: number; | ||
handlerVersionName: string; | ||
isReplay: boolean; | ||
protected log: Logger; | ||
@@ -17,0 +19,0 @@ protected effectRunMode: EffectRunMode; |
@@ -32,3 +32,5 @@ "use strict"; | ||
this.lastProcessedBlockHash = ''; | ||
this.lastIrreversibleBlockNumber = 0; | ||
this.handlerVersionName = 'v1'; | ||
this.isReplay = false; | ||
this.initialized = false; | ||
@@ -59,2 +61,3 @@ this.deferredEffects = {}; | ||
yield this.handleRollback(isRollback, blockInfo.blockNumber, isReplay, isEarliestBlock); | ||
yield this.refreshIndexState(); | ||
const nextBlockNeeded = this.lastProcessedBlockNumber + 1; | ||
@@ -219,7 +222,3 @@ // Just processed this block; skip | ||
this.log.info(`Rolled back ${rollbackCount} blocks to block ${rollbackBlockNumber} (${rollbackTime}ms)`); | ||
yield this.refreshIndexState(); | ||
} | ||
else if (this.lastProcessedBlockNumber === 0 && this.lastProcessedBlockHash === '') { | ||
yield this.refreshIndexState(); | ||
} | ||
}); | ||
@@ -360,6 +359,8 @@ } | ||
const refreshStart = Date.now(); | ||
const { blockNumber, blockHash, handlerVersionName } = yield this.loadIndexState(); | ||
this.lastProcessedBlockNumber = blockNumber; | ||
this.lastProcessedBlockHash = blockHash; | ||
this.handlerVersionName = handlerVersionName; | ||
const indexState = yield this.loadIndexState(); | ||
this.lastProcessedBlockNumber = indexState.blockNumber; | ||
this.lastProcessedBlockHash = indexState.blockHash; | ||
this.lastIrreversibleBlockNumber = indexState.lastIrreversibleBlockNumber; | ||
this.handlerVersionName = indexState.handlerVersionName; | ||
this.isReplay = indexState.isReplay; | ||
const refreshTime = Date.now() - refreshStart; | ||
@@ -366,0 +367,0 @@ this.log.debug(`Loaded Index State (${refreshTime}ms)`); |
{ | ||
"name": "demux", | ||
"version": "5.0.2-528", | ||
"version": "5.0.2-533", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "name": "block.one", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
127009
1735