diff --git a/src/oracle/oracle.ts b/src/oracle/oracle.ts index 38f8da6..bf09b6e 100644 --- a/src/oracle/oracle.ts +++ b/src/oracle/oracle.ts @@ -76,7 +76,8 @@ export class Oracle extends Config { async checkConnectivity(logs: boolean) { try { const switched = await this.switchToBackup(logs); - if(switched) { + const isClosed = this.event.readyState == EventSource.CLOSED; + if(switched || isClosed) { this.event.close(); EpochListener(this); } diff --git a/src/oracle/rebalancer.ts b/src/oracle/rebalancer.ts index a61186b..011171d 100644 --- a/src/oracle/rebalancer.ts +++ b/src/oracle/rebalancer.ts @@ -44,7 +44,7 @@ export async function Rebalancer (oracle: Oracle, data: any) { export async function proposeEpoch(epochData: any, oracle: Oracle, priority: number): Promise { try { // Random priority to avoid failed tx - await setTimeout((priority * 30) * 1000); + await setTimeout((priority * 40) * 1000); // Submit vote const contract = oracle.governance;