Skip to content

Commit 4afabc4

Browse files
Bump batch size and client timeout
1 parent c424183 commit 4afabc4

File tree

2 files changed

+40000
-3
lines changed

2 files changed

+40000
-3
lines changed

open_rarity/resolver/opensea_api_helpers.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
)
2222
import httpx
2323

24-
client = httpx.AsyncClient()
2524
logger = logging.getLogger("open_rarity_logger")
2625

2726
# https://docs.opensea.io/reference/retrieving-a-single-collection
@@ -349,7 +348,7 @@ async def get_collection_from_opensea(
349348

350349
# Fetch token metadata
351350
tokens: list[Token] = []
352-
batch_size = 20
351+
batch_size = 30
353352
initial_token_id = 0
354353

355354
# Return list of lists for batched token_ids
@@ -366,7 +365,7 @@ def batch_token_ids(
366365

367366
# We need to bound the number of awaitables to avoid hitting the OS rate limit
368367
sem = aio.BoundedSemaphore(4)
369-
async with httpx.AsyncClient() as client:
368+
async with httpx.AsyncClient(timeout=5) as client:
370369
tasks = [
371370
get_tokens_from_opensea(
372371
opensea_slug=opensea_collection_slug,

0 commit comments

Comments
 (0)