Skip to content

Commit

Permalink
added rollbar
Browse files Browse the repository at this point in the history
  • Loading branch information
introkun committed Mar 27, 2024
1 parent a2e304e commit e1dfc8d
Show file tree
Hide file tree
Showing 6 changed files with 212 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
echo "Writing config wile"
echo "${{vars.PROD_CONFIG}}" > config/production.json
echo "${{secrets.ROLLBAR_SERVER_TOKEN}}" > .env
echo "Renaming current app folder"
mv $appDir $appDir.$(date +\%Y\%m\%d\%H\%M\%S)
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ node_modules
config/debug.json

mainpage.png

.env
189 changes: 189 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
"license": "MIT",
"dependencies": {
"config": "^3.3.11",
"dotenv": "^16.4.5",
"nedb": "^1.8.0",
"puppeteer": "^22.6.1",
"rollbar": "^2.26.4",
"yargs": "^17.7.2"
},
"type": "module",
Expand Down
15 changes: 14 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@ import DealsStorage from './storage/dealsStorage.js';
import SectionsStorage from './storage/sectionsStorage.js';
import ExperiencesStorage from './storage/experiencesStorage.js';

import Rollbar from 'rollbar';
import dotenv from 'dotenv';

dotenv.config();

const ROLLBAR_SERVER_TOKEN = process.env.ROLLBAR_SERVER_TOKEN;

const rollbar = new Rollbar({
accessToken: ROLLBAR_SERVER_TOKEN,
captureUncaught: true,
captureUnhandledRejections: true,
});

const SCRAPE_SECTION_COMMAND = 'scrape-section';

const argv = yargs(hideBin(process.argv))
Expand All @@ -30,7 +43,7 @@ async function main() {
// Start the browser and create a browser instance
const startBrowserHeadless = !isInDebugMode();
const browserInstance = browser.startBrowser(startBrowserHeadless);
const scraperController = new ScraperController();
const scraperController = new ScraperController(rollbar);

let result = [];

Expand Down
Loading

0 comments on commit e1dfc8d

Please sign in to comment.