pull/739/head
Andrey 2022-12-15 18:58:54 +02:00
rodzic 1935d7fbcd
commit e1aafd7552
2 zmienionych plików z 11 dodań i 2 usunięć

Wyświetl plik

@ -39,7 +39,7 @@ def crawl_uri(metadata_uri: str) -> Any:
while retry < 3:
try:
response = urllib.request.urlopen(metadata_uri, timeout=5)
response = urllib.request.urlopen(metadata_uri, timeout=10)
if response.status == 200:
result = json.loads(response.read())
@ -52,6 +52,7 @@ def crawl_uri(metadata_uri: str) -> Any:
continue
except Exception as err:
logger.error(err)
logger.error(f"request end with error for url: {metadata_uri}")
retry += 1
continue
return result

Wyświetl plik

@ -93,15 +93,23 @@ def get_uris_of_tokens(
{"table": table, "label": VIEW_STATE_CRAWLER_LABEL, "name": "tokenURI"},
)
index = 0
for data in metadata_for_parsing:
index += 1
print(data)
if index == 100:
break
results = [
TokenURIs(
token_id=data[0],
token_uri=data[1],
token_uri=data[1][0],
block_number=data[2],
block_timestamp=data[3],
address=data[4],
)
for data in metadata_for_parsing
if data[1] is not None and len(data[1]) > 0
]
return results