Skip to content

Commit

Permalink
feat: enable sentry integration for manage-db.py functions (#3087)
Browse files Browse the repository at this point in the history
This is primarily aimed at the cleanup/database dump cronjobs, which currently have no visibility, but I imagine it will also be helpful for database upgrades as well.
  • Loading branch information
bhearsum committed Jan 16, 2024
1 parent 40466b8 commit bc357f6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/manage-db.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import itertools
import logging
import os
import sys
from os import path
from subprocess import run
Expand Down Expand Up @@ -198,6 +199,11 @@ def _strip_multiple_spaces(string):

action = args[0]

if os.environ.get("SENTRY_DSN"):
import sentry_sdk

sentry_sdk.init(os.environ["SENTRY_DSN"])

db = AUSDatabase(options.db, mysql_traditional_mode=True)
if action == "create":
db.create(options.version)
Expand Down

0 comments on commit bc357f6

Please sign in to comment.