Skip to content

Commit

Permalink
fix(sentry): removed from variables
Browse files Browse the repository at this point in the history
  • Loading branch information
StanGirard committed Jul 2, 2023
1 parent 9cc37cf commit 3918ad3
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 40 deletions.
2 changes: 1 addition & 1 deletion backend/routes/chat_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def check_user_limit(
max_requests_number = os.getenv("MAX_REQUESTS_NUMBER", 1000)

user.increment_user_request_count(date)
if user.requests_count >= max_requests_number:
if str(user.requests_count) >= str(max_requests_number):
raise HTTPException(
status_code=429,
detail="You have reached the maximum number of requests for today.",
Expand Down
80 changes: 41 additions & 39 deletions frontend/next.config.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,44 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};

module.exports = nextConfig;


// Injected content via Sentry wizard below

const { withSentryConfig } = require("@sentry/nextjs");

module.exports = withSentryConfig(
module.exports,
{
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options

// Suppresses source map uploading logs during build
silent: true,

org: "quivr-0f",
project: "javascript-nextjs",
},
{
// For all available options, see:
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/

// Upload a larger set of source maps for prettier stack traces (increases build time)
widenClientFileUpload: true,

// Transpiles SDK to be compatible with IE11 (increases bundle size)
transpileClientSDK: true,

// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
tunnelRoute: "/monitoring",

// Hides source maps from generated client bundles
hideSourceMaps: true,

// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,
}
);
// Check if the SENTRY_DSN environment variable is defined
if (process.env.SENTRY_DSN) {
// SENTRY_DSN exists, include Sentry configuration
const { withSentryConfig } = require("@sentry/nextjs");

module.exports = withSentryConfig(
nextConfig,
{
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options

// Suppresses source map uploading logs during build
silent: true,

org: "quivr-0f",
project: "javascript-nextjs",
},
{
// For all available options, see:
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/

// Upload a larger set of source maps for prettier stack traces (increases build time)
widenClientFileUpload: true,

// Transpiles SDK to be compatible with IE11 (increases bundle size)
transpileClientSDK: true,

// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
tunnelRoute: "/monitoring",

// Hides source maps from generated client bundles
hideSourceMaps: true,

// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,
}
);
} else {
// SENTRY_DSN does not exist, export nextConfig without Sentry
module.exports = nextConfig;
}

0 comments on commit 3918ad3

Please sign in to comment.