|
|
|
@ -295,8 +295,7 @@ class Scrape extends Collection {
|
|
|
|
|
txDate: timestamp
|
|
|
|
|
}
|
|
|
|
|
writeToDatabase(q)
|
|
|
|
|
.then((res) => this.writeLastBlock(log.blockNumber))
|
|
|
|
|
.catch((err) => console.log(`Error writing to database: ${err}`));
|
|
|
|
|
.then(async _ => {
|
|
|
|
|
let notifSent = await checkUnsentNotif(txHash, logIndex);
|
|
|
|
|
if (process.env.DISCORD_ACTIVE == 1 && (notifSent || process.env.FORCE == 1)) {
|
|
|
|
|
postDiscord(q)
|
|
|
|
@ -306,6 +305,9 @@ class Scrape extends Collection {
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => console.log(`Error posting to Discord: ${err}`));
|
|
|
|
|
}
|
|
|
|
|
this.writeLastBlock(log.blockNumber);
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => console.log(`Error writing to database: ${err}`));
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} catch(err) {
|
|
|
|
|