Skip to content

Commit

Permalink
More reports
Browse files Browse the repository at this point in the history
  • Loading branch information
akariv committed Jun 11, 2024
1 parent cf9fa3e commit 7d548dc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions odds/backend/processor/resource_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,14 @@ async def process(self, resource: Resource, dataset: Dataset, catalog: DataCatal
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:124.0) Gecko/20100101 Firefox/124.0'
}
headers.update(catalog.http_headers)
report = 0
async with client.stream('GET', resource.url, headers=headers, timeout=60, follow_redirects=True) as response:
async for chunk in response.aiter_bytes():
f.write(chunk)
total_size += len(chunk)
while total_size - report > 1000000:
report += 1000000
rts.set(ctx, f'DOWNLOADED {report} BYTES from {resource.url} to {filename}')

rts.set(ctx, f'DOWNLOADED {total_size} BYTES from {resource.url} to {filename}')
dp, _ = DF.Flow(
Expand Down

0 comments on commit 7d548dc

Please sign in to comment.