import sys
import time
from fast_bitrix24 import Bitrix
start = time.time()
bx24 = Bitrix(
"https://**.bitrix24.ru/rest/11/*****",
respect_velocity_policy=True,
)
deals = bx24.get_all(
"crm.deal.list",
)
print(len(deals))
print(sys.getsizeof(deals), "bytes")
product_rows = bx24.get_by_ID("crm.deal.productrows.get", [d["ID"] for d in deals])
print(len(product_rows))
print(product_rows[:50])
end = time.time()
print(end - start)
Трейсинг:
100%|██████████| 12745/12745 [00:44<00:00, 287.24it/s]
12745
107896 bytes
0%| | 0/12745 [00:00<?, ?it/s]
Traceback (most recent call last):
File "C:\Users\ilyap\PycharmProjects\different\bitrix_fast.py", line 75, in <module>
product_rows = bx24.get_by_ID("crm.deal.productrows.get", [d["ID"] for d in result1])
File "C:\Users\ilyap\PycharmProjects\different\venv\lib\site-packages\fast_bitrix24\bitrix.py", line 234, in sync_wrapper
return loop.run_until_complete(coroutine(*args, **kwargs))
File "C:\Program Files\Python310\lib\asyncio\base_events.py", line 641, in run_until_complete
return future.result()
File "C:\Users\ilyap\PycharmProjects\different\venv\lib\site-packages\fast_bitrix24\logger.py", line 11, in wrapper
return await func(*args, **kwargs)
File "C:\Users\ilyap\PycharmProjects\different\venv\lib\site-packages\fast_bitrix24\bitrix.py", line 112, in get_by_ID
return await self.srh.run_async(
File "C:\Users\ilyap\PycharmProjects\different\venv\lib\site-packages\fast_bitrix24\srh.py", line 100, in run_async
return await coroutine
File "C:\Users\ilyap\PycharmProjects\different\venv\lib\site-packages\fast_bitrix24\user_request.py", line 207, in run
results = await MultipleServerRequestHandlerPreserveIDs(
File "C:\Users\ilyap\PycharmProjects\different\venv\lib\site-packages\fast_bitrix24\mult_request.py", line 57, in run
extracted_len = self.process_done_tasks(done)
File "C:\Users\ilyap\PycharmProjects\different\venv\lib\site-packages\fast_bitrix24\mult_request.py", line 85, in process_done_tasks
batch_response = done_task.result()
File "C:\Users\ilyap\PycharmProjects\different\venv\lib\site-packages\fast_bitrix24\srh.py", line 129, in single_request
result = await self.request_attempt(method, params)
File "C:\Users\ilyap\PycharmProjects\different\venv\lib\site-packages\fast_bitrix24\srh.py", line 142, in request_attempt
async with self.session.post(
File "C:\Users\ilyap\PycharmProjects\different\venv\lib\site-packages\aiohttp\client.py", line 1138, in __aenter__
self._resp = await self._coro
File "C:\Users\ilyap\PycharmProjects\different\venv\lib\site-packages\aiohttp\client.py", line 640, in _request
resp.raise_for_status()
File "C:\Users\ilyap\PycharmProjects\different\venv\lib\site-packages\aiohttp\client_reqrep.py", line 1004, in raise_for_status
raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 429, message='Too Many Requests', url=URL('https://*****.bitrix24.ru/rest/11/***********/batch')
Process finished with exit code 1
Код:
Трейсинг: