Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
upgrade sentry + run migr8
Browse files Browse the repository at this point in the history
  • Loading branch information
wdhdev committed Jul 17, 2024
1 parent e92b60f commit 14cec50
Show file tree
Hide file tree
Showing 4 changed files with 1,505 additions and 95 deletions.
26 changes: 2 additions & 24 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require("./instrument");
const express = require("express");
const app = express();

Expand All @@ -8,16 +9,6 @@ const Sentry = require("@sentry/node");
const bodyParser = require("body-parser");
const cors = require("cors");

Sentry.init({
dsn: process.env.sentry_dsn,
integrations: [
new Sentry.Integrations.Http({ tracing: true }),
new Sentry.Integrations.Express({ app }),
...Sentry.autoDiscoverNodePerformanceMonitoringIntegrations()
],
tracesSampleRate: 1.0
})

const router = require("./util/router");

app.use(Sentry.Handlers.requestHandler());
Expand All @@ -32,21 +23,8 @@ app.set("view engine", "ejs");

app.use("/", router);

app.use(Sentry.Handlers.errorHandler());
Sentry.setupExpressErrorHandler(app);

app.listen(port, () => {
console.log(`Listening on Port: ${port}`);
})

const { exec } = require("child_process");

// Automatic Git Pull
setInterval(() => {
exec("git pull", (err, stdout) => {
if(err) return console.log(err);
if(stdout.includes("Already up to date.")) return;

console.log(stdout);
process.exit();
})
}, 30 * 1000) // 30 seconds
10 changes: 10 additions & 0 deletions instrument.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const Sentry = require("@sentry/node");
const { nodeProfilingIntegration } = require("@sentry/profiling-node");
Sentry.init({
dsn: process.env.sentry_dsn,
integrations: [
nodeProfilingIntegration()
],
tracesSampleRate: 1.0,
profilesSampleRate: 1.0
});
Loading

0 comments on commit 14cec50

Please sign in to comment.