Skip to content

Commit e1aafd7

Browse files
author
Andrey
committed
Add fixes
1 parent 1935d7f commit e1aafd7

File tree

2 files changed

+11
-2
lines changed
  • crawlers/mooncrawl/mooncrawl/metadata_crawler

2 files changed

+11
-2
lines changed

crawlers/mooncrawl/mooncrawl/metadata_crawler/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def crawl_uri(metadata_uri: str) -> Any:
3939
while retry < 3:
4040
try:
4141

42-
response = urllib.request.urlopen(metadata_uri, timeout=5)
42+
response = urllib.request.urlopen(metadata_uri, timeout=10)
4343

4444
if response.status == 200:
4545
result = json.loads(response.read())
@@ -52,6 +52,7 @@ def crawl_uri(metadata_uri: str) -> Any:
5252
continue
5353
except Exception as err:
5454
logger.error(err)
55+
logger.error(f"request end with error for url: {metadata_uri}")
5556
retry += 1
5657
continue
5758
return result

crawlers/mooncrawl/mooncrawl/metadata_crawler/db.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,23 @@ def get_uris_of_tokens(
9393
{"table": table, "label": VIEW_STATE_CRAWLER_LABEL, "name": "tokenURI"},
9494
)
9595

96+
index = 0
97+
for data in metadata_for_parsing:
98+
index += 1
99+
print(data)
100+
if index == 100:
101+
break
102+
96103
results = [
97104
TokenURIs(
98105
token_id=data[0],
99-
token_uri=data[1],
106+
token_uri=data[1][0],
100107
block_number=data[2],
101108
block_timestamp=data[3],
102109
address=data[4],
103110
)
104111
for data in metadata_for_parsing
112+
if data[1] is not None and len(data[1]) > 0
105113
]
106114

107115
return results

0 commit comments

Comments
 (0)