Skip to content

Commit

Permalink
Fix timed-out issue on ganace (in dev mode generally) (#509)
Browse files Browse the repository at this point in the history
  • Loading branch information
forshtat authored Sep 30, 2020
1 parent 87a1256 commit 34542d1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.0.0",
"version": "2.0.1",
"description": "Open Gas Stations Network",
"name": "@opengsn/gsn",
"license": "MIT",
Expand Down
1 change: 1 addition & 0 deletions src/relayclient/GsnTestEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ class GsnTestEnvironmentClass {
workersKeyManager
}
const relayServerParams: Partial<ServerConfigParams> = {
devMode: true,
url: relayUrl,
relayHubAddress: deploymentResult.relayHubAddress,
gasPriceFactor: 1,
Expand Down
1 change: 0 additions & 1 deletion src/relayserver/RegistrationManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,6 @@ Owner | ${this.ownerAddress ?? chalk.red('unknown')}

printEvents (decodedEvents: EventData[], options: PastEventOptions): void {
if (decodedEvents.length === 0) {
log.debug(`No new events emitted since block: ${options.fromBlock?.toString()}`)
return
}
log.info(`Handling ${decodedEvents.length} events emitted since block: ${options.fromBlock?.toString()}`)
Expand Down
3 changes: 2 additions & 1 deletion src/relayserver/RelayServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,8 @@ latestBlock timestamp | ${latestBlock.timestamp}
isReady (): boolean {
if (!this.ready) { return false }

if ((Date.now() - this.lastWorkerFinished) > this.config.readyTimeout) {
const timedOut = (Date.now() - this.lastWorkerFinished) > this.config.readyTimeout
if (!this.config.devMode && timedOut) {
log.warn(chalk.bgRedBright('Relay state: Timed-out'))
this.ready = false
}
Expand Down

0 comments on commit 34542d1

Please sign in to comment.