totoroterror/warp-cloner

Properly work with parallel generations

Closed this issue · 0 comments

In current release, we're waiting for slowest response and then handle all answers, it will be better to add some kind of workers

async def worker(id: int, initial_delay: int = 0, keys: list[str] = config.BASE_KEYS.split(',')):
    await sleep(initial_delay) 
    while True:
         await clone_key(...)
         await sleep(cfg.DELAY)
   
async def main():
     await asyncio.gather(worker(i, cfg.delay / worker_num * i) for i in range(worker_num) )