mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 02:57:34 +00:00
feat: add email test, fix memory leak (#24)
Co-authored-by: Jef LeCompte <jeffreylec@gmail.com>
This commit is contained in:
+2
-1
@@ -1,6 +1,7 @@
|
||||
EMAIL_USERNAME="youremail@gmail.com"
|
||||
EMAIL_PASSWORD="secretpassword"
|
||||
EMAIL_TEST="true"
|
||||
NOTIFICATION_METHODS="email"
|
||||
SLACK_CHANNEL="SlackChannelName"
|
||||
SLACK_TOKEN="slack-token"
|
||||
STORES="bestbuy,bandh,nvidia"
|
||||
NOTIFICATION_METHODS="email"
|
||||
|
||||
+2
-1
@@ -5,7 +5,8 @@ config({path: resolve(__dirname, '../.env')});
|
||||
|
||||
const email = {
|
||||
username: process.env.EMAIL_USERNAME,
|
||||
password: process.env.EMAIL_PASSWORD
|
||||
password: process.env.EMAIL_PASSWORD,
|
||||
test: process.env.EMAIL_TEST ?? 'false'
|
||||
};
|
||||
|
||||
const notifications = {
|
||||
|
||||
@@ -5,6 +5,13 @@ import open from 'open';
|
||||
import sendNotification from './notification';
|
||||
import {Logger} from './logger';
|
||||
|
||||
/**
|
||||
* Send test email.
|
||||
*/
|
||||
if (Config.email.test === 'true') {
|
||||
sendNotification('test');
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts the bot.
|
||||
*/
|
||||
@@ -45,6 +52,7 @@ async function lookup(store: Store) {
|
||||
await page.goto(link.url, {waitUntil: 'networkidle0'});
|
||||
} catch {
|
||||
Logger.error(`✖ [${store.name}] ${graphicsCard} skipping; timed out`);
|
||||
await browser.close();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user