Skip to content

Commit

Permalink
log new labels when running locally, add gore and spam to global labels
Browse files Browse the repository at this point in the history
  • Loading branch information
snarfed committed Oct 21, 2024
1 parent 6561820 commit ffe4010
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@
'!no-unauthenticated',
'!warn',
'graphic-media',
'gore',
'nudity',
'porn',
'sexual',
'spam',
]

KNOWN_LABELS = [
Expand Down Expand Up @@ -105,8 +107,12 @@ 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} {commit["cid"]} {msg["time_us"]}')
if val not in KNOWN_LABELS:
log = f'new label! {val} {uri} {commit["cid"]} {msg["time_us"]}'
if PROD:
error_reporting_client.report(log)
else:
logger.warning(log)
label = {
'ver': 1,
'src': msg['did'],
Expand Down

0 comments on commit ffe4010

Please sign in to comment.