Only log suspicious-sweep actions, not routine no-op skips/clears
With the sweep now running every 10 minutes, the per-run 'N due' summary and per-account skip/clear log lines (already-limited, staff, cleared by activity, not found) were mostly noise drowning out the actual suspend/ silence actions. Those states are still recorded in suspicious_watch.status for anyone querying the DB directly; only the taken action, dry-run simulation, and error paths still log.
This commit is contained in:
@@ -97,11 +97,9 @@ def _is_allowlisted(acct: str) -> bool:
|
|||||||
|
|
||||||
def sweep() -> None:
|
def sweep() -> None:
|
||||||
if not SUSPICIOUS_SWEEP_ENABLED:
|
if not SUSPICIOUS_SWEEP_ENABLED:
|
||||||
log.info("SUSPICIOUS_SWEEP_ENABLED=false, nothing to do")
|
|
||||||
return
|
return
|
||||||
|
|
||||||
due = _pending_due()
|
due = _pending_due()
|
||||||
log.info("%d flagged signup(s) past the %dh grace window", len(due), SUSPICIOUS_GRACE_HOURS)
|
|
||||||
|
|
||||||
for account_id, acct, reasons, baseline_statuses, baseline_following in due:
|
for account_id, acct, reasons, baseline_statuses, baseline_following in due:
|
||||||
try:
|
try:
|
||||||
@@ -111,17 +109,14 @@ def sweep() -> None:
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
if admin_acct is None:
|
if admin_acct is None:
|
||||||
log.info("acct=%s no longer exists, clearing watch", acct)
|
|
||||||
_resolve(account_id, "skipped-not-found")
|
_resolve(account_id, "skipped-not-found")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if admin_acct.get("suspended") or admin_acct.get("silenced"):
|
if admin_acct.get("suspended") or admin_acct.get("silenced"):
|
||||||
log.info("acct=%s already limited by another mechanism, clearing watch", acct)
|
|
||||||
_resolve(account_id, "skipped-already-limited")
|
_resolve(account_id, "skipped-already-limited")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if (_is_privileged(admin_acct) and ABUSE_SKIP_PRIVILEGED) or _is_allowlisted(acct):
|
if (_is_privileged(admin_acct) and ABUSE_SKIP_PRIVILEGED) or _is_allowlisted(acct):
|
||||||
log.info("acct=%s is staff/allowlisted, clearing watch", acct)
|
|
||||||
_resolve(account_id, "skipped-privileged")
|
_resolve(account_id, "skipped-privileged")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@@ -130,10 +125,6 @@ def sweep() -> None:
|
|||||||
following_count = public.get("following_count", 0)
|
following_count = public.get("following_count", 0)
|
||||||
|
|
||||||
if statuses_count > baseline_statuses or following_count > baseline_following:
|
if statuses_count > baseline_statuses or following_count > baseline_following:
|
||||||
log.info(
|
|
||||||
"acct=%s showed activity since flagging (posts %d->%d, following %d->%d), clearing watch",
|
|
||||||
acct, baseline_statuses, statuses_count, baseline_following, following_count,
|
|
||||||
)
|
|
||||||
_resolve(account_id, "cleared")
|
_resolve(account_id, "cleared")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user