From 7e060e5cf2656a0a53d41ea0ff42b753316cd441 Mon Sep 17 00:00:00 2001 From: mia Date: Fri, 4 Oct 2024 15:43:40 -0700 Subject: she's goin --- 1_graph.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to '1_graph.py') 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(): -- cgit 1.4.1