Skip to content

Commit f2a1c4c

Browse files
author
Jim Fulton
committed
Added Sentry support for the arc2box script.
1 parent 27c6b61 commit f2a1c4c

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

buildout.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ login_cookie_max_age = 36000
129129
mail_white_list =
130130
static_rev =
131131
redis = redislog = false
132+
sentry =
132133
statsd_uri =
133134
statsd_uri = statsd://localhost:8125
134135
statsd =
@@ -205,6 +206,7 @@ text =
205206
mailin_trace_file = ${:var}/mailin_trace
206207

207208
${:redis}
209+
${:sentry}
208210

209211
${:statsd_uri}
210212
framestats = ${:framestats}

karl/box/archive.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ def worker():
401401
root, closer = open_root(config)
402402

403403
registry = get_current_registry()
404+
sentry_dsn = registry.settings.get('sentry_dsn')
404405
queue = RedisArchiveQueue.from_settings(registry.settings)
405406

406407
if options.refresh_authentication:
@@ -440,6 +441,9 @@ def worker():
440441
transaction.begin()
441442
community.archive_status = 'exception'
442443
transaction.commit()
444+
if sentry_dsn:
445+
import raven
446+
raven.Client(sentry_dsn).captureException()
443447
raise
444448
finally:
445449
# Persist log in its own transaction so that even if there is an

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
'pyramid_tm',
4949
'pyramid_zcml',
5050
'formish<0.9',
51+
'raven',
5152
'redis', # archive to box
5253
'repoze.browserid',
5354
'repoze.catalog>=0.8.3', # 'total' attribute of numdocs

versions.cfg

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,3 +434,13 @@ newt.db = 0.9.0
434434
# Required by:
435435
# karl==4.31.1
436436
newt.qbe = 0.1.1
437+
438+
# Added by buildout at 2017-08-08 13:08:55.132034
439+
440+
# Required by:
441+
# raven==6.1.0
442+
contextlib2 = 0.5.5
443+
444+
# Required by:
445+
# karl==4.31.1
446+
raven = 6.1.0

0 commit comments

Comments
 (0)