Refactoring and linting, added notifications about frequent search errors

This commit is contained in:
Soxoj
2021-04-30 12:03:13 +03:00
parent bfaf276f6e
commit bfa6afac32
20 changed files with 1351 additions and 787 deletions
+3 -4
View File
@@ -2,7 +2,7 @@ import asyncio
import time
import tqdm
import sys
from typing import Iterable
from typing import Iterable, Any, List
from .types import QueryDraft
@@ -100,14 +100,13 @@ class AsyncioProgressbarQueueExecutor(AsyncExecutor):
self.queue.task_done()
async def _run(self, queries: Iterable[QueryDraft]):
self.results = []
self.results: List[Any] = []
queries_list = list(queries)
min_workers = min(len(queries_list), self.workers_count)
workers = [create_task_func()(self.worker())
for _ in range(min_workers)]
workers = [create_task_func()(self.worker()) for _ in range(min_workers)]
self.progress = self.progress_func(total=len(queries_list))
for t in queries_list: