Skip to content

Commit f8cc9c4

Browse files
committed
fix(inbox): add rate-limit delay between arXiv fetch calls
1 parent 3b06424 commit f8cc9c4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

automation/inbox/reader.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212

1313
import logging
1414
import re
15+
import time
1516
from typing import Any
1617

1718
from automation.review import github as gh
18-
from automation.crawler.arxiv import fetch_single_paper
19+
from automation.crawler.arxiv import fetch_single_paper, _REQUEST_DELAY
1920

2021
logger = logging.getLogger(__name__)
2122

@@ -86,6 +87,7 @@ def read_inbox(
8687
fetched_any = True
8788
else:
8889
logger.warning("Inbox: could not fetch %s", aid)
90+
time.sleep(_REQUEST_DELAY) # respect arXiv rate limit
8991

9092
# Mark comment as processed with 👍 reaction
9193
if fetched_any:

0 commit comments

Comments
 (0)