remove unnecessary await

This commit is contained in:
MrTuxedo 2023-04-21 22:20:09 -07:00
parent b16ef7c368
commit 34f7f23ae8

View File

@ -24,7 +24,7 @@ const client = new DiscordClient({ intents: [GatewayIntentBits.Guilds, GatewayIn
const doAlerts = createGasAlertChecker(client); const doAlerts = createGasAlertChecker(client);
const setDiscordStatus = async ({ average, fast, slow }: GasPrices) => { const setDiscordStatus = ({ average, fast, slow }: GasPrices) => {
if (client.user) { if (client.user) {
client.user.setActivity( client.user.setActivity(
`${fast} ⦚🚶 ${average} ⦚ 🐢 ${slow}` `${fast} ⦚🚶 ${average} ⦚ 🐢 ${slow}`
@ -74,12 +74,12 @@ client.login(token)
await redisClient.connect() await redisClient.connect()
.catch((reason) => console.log("Error connecting to redis!\n", reason)) .catch((reason) => console.log("Error connecting to redis!\n", reason))
}) })
.then(async () => { .then(() => {
// Start listening to blockchain // Start listening to blockchain
averageGasPricesObservable.subscribe({ averageGasPricesObservable.subscribe({
next: async (averageGasPrices) => { next: async (averageGasPrices) => {
setDiscordStatus(averageGasPrices);
await redisClient.set('current-prices', JSON.stringify(averageGasPrices)) await redisClient.set('current-prices', JSON.stringify(averageGasPrices))
await setDiscordStatus(averageGasPrices);
await doAlerts(averageGasPrices); await doAlerts(averageGasPrices);
}, },
error: console.error, error: console.error,