Smaller queue, rm unsubscribe, etc
This commit is contained in:
parent
9e03a442e3
commit
486bebaed9
|
@ -27,7 +27,7 @@ class WorkerManager:
|
|||
self.base = "https://onemillioncheckboxes.com"
|
||||
self.delay = 0.25
|
||||
self.batch_size = 7
|
||||
self.queue: asyncio.Queue[int] = asyncio.Queue(128)
|
||||
self.queue: asyncio.Queue[int] = asyncio.Queue(64)
|
||||
|
||||
self.n_toggles = 0
|
||||
self.workers: set[tuple[int, int]] = set()
|
||||
|
@ -73,7 +73,7 @@ class WorkerManager:
|
|||
cookie = bot_index, self._restarts[bot_index]
|
||||
self.workers.add(cookie)
|
||||
|
||||
await sio.emit("unsubscribe")
|
||||
# await sio.emit("unsubscribe")
|
||||
|
||||
try:
|
||||
batch = 0
|
||||
|
@ -86,6 +86,7 @@ class WorkerManager:
|
|||
self.shmem.buf[OFFSET_STATE + byte] & mask
|
||||
):
|
||||
await sio.emit("toggle_bit", {"index": index})
|
||||
self.shmem.buf[OFFSET_STATE + byte] ^= mask
|
||||
self.n_toggles += 1
|
||||
self.queue.task_done()
|
||||
batch += 1
|
||||
|
|
Loading…
Reference in New Issue