adds sentry support to send errors. in sentry.io you can create a free account for small sites.

This commit is contained in:
saint 2024-02-28 17:25:10 +01:00
parent 7cff8ceeac
commit a0fc14bdd9
4 changed files with 10 additions and 0 deletions

View file

@ -36,6 +36,13 @@ def create_app(config_class=Config):
app = Flask(__name__)
app.config.from_object(config_class)
if app.config['SENTRY_DSN']:
import sentry_sdk
sentry_sdk.init(
dsn=app.config["SENTRY_DSN"],
enable_tracing=True
)
db.init_app(app)
migrate.init_app(app, db, render_as_batch=True)
login.init_app(app)

View file

@ -38,3 +38,4 @@ class Config(object):
BOUNCE_USERNAME = os.environ.get('BOUNCE_USERNAME') or ''
BOUNCE_PASSWORD = os.environ.get('BOUNCE_PASSWORD') or ''
SENTRY_DSN = os.environ.get('SENTRY_DSN') or None

View file

@ -16,3 +16,4 @@ BOUNCE_USERNAME=''
BOUNCE_PASSWORD=''
FLASK_APP=pyfedi.py
SENTRY_DSN=''

View file

@ -29,3 +29,4 @@ celery==5.3.6
redis==5.0.1
Werkzeug==2.3.3
pytesseract==0.3.10
sentry-sdk==1.40.6