Skip to content

Commit

Permalink
minor bug fixes for error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
snarfed committed Oct 21, 2024
1 parent 270c8e9 commit 6561820
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def jetstream():
uri = f'at://{msg["did"]}/{commit["collection"]}/{commit["rkey"]}'
for val in values:
if PROD and val not in KNOWN_LABELS:
error_reporting_client.report(f'new label! {val} {uri} {cid}')
error_reporting_client.report(f'new label! {val} {uri} {commit["cid"]} {msg["time_us"]}')
label = {
'ver': 1,
'src': msg['did'],
Expand All @@ -118,7 +118,7 @@ def jetstream():
arroba.util.sign(label, privkey)
labels['labels'].append(label)

logger.info(f'emitting {len(labels["labels"])} to {len(subscribers)} subscribers for {uri} ')
logger.info(f'emitting {len(labels["labels"])} labels to {len(subscribers)} subscribers for {uri} ')
for sub in subscribers:
sub.put(labels)

Expand All @@ -127,7 +127,9 @@ def jetstream():

except BaseException as err:
if PROD:
error_reporting_client.report_error(msg=None, exception=True)
error_reporting_client.report_exception()
else:
raise


@xrpc_server.method('com.atproto.label.subscribeLabels')
Expand Down

0 comments on commit 6561820

Please sign in to comment.