Skip to content

Commit

Permalink
small test
Browse files Browse the repository at this point in the history
  • Loading branch information
acer-king committed Oct 15, 2024
1 parent dd1e42a commit ce7bb34
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions validators/weight_setter.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,10 @@ def is_cycle_end(self):

async def perform_synthetic_queries(self):
while True:
if not self.is_cycle_end():
await asyncio.sleep(12)
continue
self.set_up_next_block_to_wait()
# if not self.is_cycle_end():
# await asyncio.sleep(12)
# continue
# self.set_up_next_block_to_wait()
start_time = time.time()
# don't process any organic query while processing synthetic queries.
async with self.lock:
Expand Down Expand Up @@ -266,9 +266,10 @@ async def perform_synthetic_queries(self):

bt.logging.info(
f"synthetic queries and answers has been saved in cache successfully. total times {time.time() - start_time}")
break

def pop_synthetic_tasks_max_100_per_miner(self, synthetic_tasks):
batch_size = 1000
batch_size = 500
max_query_cnt_per_miner = 50
batch_tasks = []
remain_tasks = []
Expand All @@ -277,6 +278,7 @@ def pop_synthetic_tasks_max_100_per_miner(self, synthetic_tasks):
if uid_to_task_cnt[uid] < max_query_cnt_per_miner:
if len(batch_tasks) > batch_size:
remain_tasks.append((uid, synthetic_task))
break
continue
batch_tasks.append(synthetic_task)
uid_to_task_cnt[uid] += 1
Expand Down

0 comments on commit ce7bb34

Please sign in to comment.