Skip to content

Commit

Permalink
Fix imports, minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tvorogme committed Feb 19, 2024
1 parent 6607359 commit f03ae59
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/tonpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@

from tonpy.utils.address_packer import pack_address
from tonpy.utils.token import parse_token_data
from tonpy.blockscanner.blockscanner import BlockScanner
1 change: 1 addition & 0 deletions src/tonpy/blockscanner/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from tonpy.blockscanner.blockscanner import BlockScanner
9 changes: 4 additions & 5 deletions src/tonpy/blockscanner/blockscanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@ def chunk_by_txs(self, data, cs=100):
worker_to_chunk[current_worker].append(i)
cur_c += weight

print(len(worker_to_chunk.values()), min(min(1, len(worker_to_chunk)), self.nproc))
return worker_to_chunk.values(), min(min(1, len(worker_to_chunk)), self.nproc)

def load_mcs(self, from_, to_):
Expand Down Expand Up @@ -513,8 +512,7 @@ def load_historical(self):
results = pool.imap_unordered(self.f, txs_chunks)

for result_chunk in results:
for result in result_chunk:
self.out_queue.put(result)
self.out_queue.put(result_chunk)

def run(self):
self.load_historical()
Expand Down Expand Up @@ -548,7 +546,7 @@ def raw_process(chunk):
nproc=10,
loglevel=2,
chunk_size=2,
raw_process=raw_process,
raw_process=just_len,
out_queue=outq
)

Expand All @@ -560,5 +558,6 @@ def raw_process(chunk):

total_txs = 0
while not outq.empty():
total_txs += outq.get()
for result in outq.get():
total_txs += result
print("Got total: ", total_txs)

0 comments on commit f03ae59

Please sign in to comment.