diff options
author | mia <mia@mia.jetzt> | 2024-10-04 15:43:40 -0700 |
---|---|---|
committer | mia <mia@mia.jetzt> | 2024-10-04 15:43:40 -0700 |
commit | 7e060e5cf2656a0a53d41ea0ff42b753316cd441 (patch) | |
tree | 2629f3d1e12d21c406974000dd195518aa5b6041 /1_graph.py | |
parent | bb8a48fd4d85ba4f8224c68aaaf9069d5d79dae2 (diff) | |
download | scrubber-7e060e5cf2656a0a53d41ea0ff42b753316cd441.tar.gz scrubber-7e060e5cf2656a0a53d41ea0ff42b753316cd441.zip |
she's goin
Diffstat (limited to '1_graph.py')
-rw-r--r-- | 1_graph.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/1_graph.py b/1_graph.py index 824d723..e2de90d 100644 --- a/1_graph.py +++ b/1_graph.py @@ -1,5 +1,6 @@ import json import sys +import time from collections import namedtuple from functools import cache from pathlib import Path @@ -26,6 +27,7 @@ cur = conn.execute( [user_id], ) while rows := cur.fetchmany(0xFF): + time.sleep(0.0001) for row in rows: note_ids.add(row[0]) if early_exit and len(note_ids) > early_exit: @@ -34,6 +36,7 @@ while rows := cur.fetchmany(0xFF): @cache def get_note(id: str) -> Note: + time.sleep(0.0001) return Note( *conn.execute( 'select "renoteId", "replyId", "userId" from note where id = %s', [id] @@ -102,6 +105,7 @@ def traverse(tree: Tree): def expand(tree: Tree): + time.sleep(0.0001) for row in conn.execute( "select id from note_replies(%s, 1, 1000)", [tree.id] ).fetchall(): |