zenx 0.9.9__py3-none-any.whl → 0.10.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- zenx/clients/http.py +2 -2
- zenx/engine.py +4 -3
- {zenx-0.9.9.dist-info → zenx-0.10.1.dist-info}/METADATA +1 -1
- {zenx-0.9.9.dist-info → zenx-0.10.1.dist-info}/RECORD +7 -7
- {zenx-0.9.9.dist-info → zenx-0.10.1.dist-info}/WHEEL +0 -0
- {zenx-0.9.9.dist-info → zenx-0.10.1.dist-info}/entry_points.txt +0 -0
- {zenx-0.9.9.dist-info → zenx-0.10.1.dist-info}/top_level.txt +0 -0
zenx/clients/http.py
CHANGED
@@ -199,6 +199,6 @@ class CurlCffi(HttpClient):
|
|
199
199
|
count = self._session_pool.qsize()
|
200
200
|
async with asyncio.TaskGroup() as tg:
|
201
201
|
while not self._session_pool.empty():
|
202
|
-
|
203
|
-
tg.create_task(
|
202
|
+
session_wrapper: SessionWrapper = await self._session_pool.get()
|
203
|
+
tg.create_task(session_wrapper._self.close())
|
204
204
|
self.logger.debug("closed", sessions=count, client=self.name)
|
zenx/engine.py
CHANGED
@@ -26,7 +26,7 @@ class Engine:
|
|
26
26
|
self.shutdown_event.set()
|
27
27
|
|
28
28
|
|
29
|
-
async def
|
29
|
+
async def _execute_spider(self, spider_name: str) -> None:
|
30
30
|
loop = asyncio.get_running_loop()
|
31
31
|
loop.add_signal_handler(signal.SIGINT, self._shutdown_handler)
|
32
32
|
loop.add_signal_handler(signal.SIGTERM, self._shutdown_handler)
|
@@ -50,8 +50,9 @@ class Engine:
|
|
50
50
|
try:
|
51
51
|
if self.forever:
|
52
52
|
while not self.shutdown_event.is_set():
|
53
|
+
crawl_task = asyncio.create_task(spider.crawl())
|
53
54
|
try:
|
54
|
-
await
|
55
|
+
await crawl_task
|
55
56
|
except Exception:
|
56
57
|
logger.exception("crawl")
|
57
58
|
await asyncio.sleep(0.01)
|
@@ -69,7 +70,7 @@ class Engine:
|
|
69
70
|
|
70
71
|
|
71
72
|
def run_spider(self, spider: str) -> None:
|
72
|
-
uvloop.run(self.
|
73
|
+
uvloop.run(self._execute_spider(spider))
|
73
74
|
|
74
75
|
|
75
76
|
def run_spiders(self, spiders: List[str]) -> None:
|
@@ -1,14 +1,14 @@
|
|
1
1
|
zenx/cli.py,sha256=pHKhOTdqI6NQQoYK91waRIMpxCXLYtXEryzVaTbmvqc,2810
|
2
2
|
zenx/debug_runner.py,sha256=B2Jd9A4_EHDa-ohLcwnFIxOV73FagTWXX2fl3qgwlpY,809
|
3
3
|
zenx/discovery.py,sha256=YANVGzy2IG1fYruUud-11Y-ynyO6iEp3EjlHnhIQJQI,1014
|
4
|
-
zenx/engine.py,sha256=
|
4
|
+
zenx/engine.py,sha256=gH47sVH4-Xdrj_uCcuiHoNsMGCryU4GW0eScihdtTC0,2630
|
5
5
|
zenx/exceptions.py,sha256=BJXxzwwX2CU6inhppfblx8c8Z6Mhvsk7MAhQ1LAnhBg,37
|
6
6
|
zenx/logger.py,sha256=lr45XGbV769NQcwn8-lAcPfFbR4yBN8LNh7o-i4Aa9M,1652
|
7
7
|
zenx/settings.py,sha256=anTT_jSQxwIabBHCM7egYFUOnALxp4fF_26_2ZPtTt4,1044
|
8
8
|
zenx/utils.py,sha256=ouvXUd3-HaxLS3dDKbshEf-CXRf44OcovziEVIRsWNs,725
|
9
9
|
zenx/clients/__init__.py,sha256=CaAAuNa8DPyMdejR0KNSDDg_UzC3WxaTol5_QvwwwG8,132
|
10
10
|
zenx/clients/database.py,sha256=AF-L7iYrWRNzUZKn7taveiihpu--mXXC6eWOrMNlqzQ,4806
|
11
|
-
zenx/clients/http.py,sha256=
|
11
|
+
zenx/clients/http.py,sha256=glta63ANZdDZhBE9LiW590dSvPPSufkpun811LghF08,7482
|
12
12
|
zenx/pipelines/__init__.py,sha256=IxkZ0UpEJdYjLdd-PMcC9PzzzArTBNNcpgKc7NiOe5Y,131
|
13
13
|
zenx/pipelines/base.py,sha256=N_388z5DFMeaU6wMwcClZAbQFWKh4kpAF7eUJhpQevs,1863
|
14
14
|
zenx/pipelines/discord.py,sha256=4Ea52PzAViQZTVkwzvN9VxzjGVV_O4pMrqeOswtpkUo,2528
|
@@ -21,8 +21,8 @@ zenx/resources/proto/feed_pb2.py,sha256=ZyICOLnyuXekkvV4bAHZ1nE1-wwzcYYRRrmRJCMr
|
|
21
21
|
zenx/resources/proto/feed_pb2_grpc.py,sha256=Mim6FfBgIMj0PmTqHk036nVUMJH3A6I3ts6r1j3bQF8,7441
|
22
22
|
zenx/spiders/__init__.py,sha256=rs5LuqdM2MQlUYiTGJrzkYhzN8_SSLTrR7wGjSRrrSo,25
|
23
23
|
zenx/spiders/base.py,sha256=MeZ3wZOPOyOX4V2ufFXtYGCDtXHZO_mNfnXdKMkisuQ,1951
|
24
|
-
zenx-0.
|
25
|
-
zenx-0.
|
26
|
-
zenx-0.
|
27
|
-
zenx-0.
|
28
|
-
zenx-0.
|
24
|
+
zenx-0.10.1.dist-info/METADATA,sha256=aJMrUv8JOnXBB5ZtzTVfVfRM8mUvUMeeDSQiT33Cjhc,1422
|
25
|
+
zenx-0.10.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
26
|
+
zenx-0.10.1.dist-info/entry_points.txt,sha256=8JXob2f1VtvzGFris-e9Usqywg7oca-cChDlH9moOZU,38
|
27
|
+
zenx-0.10.1.dist-info/top_level.txt,sha256=JeXwvK86d7sB-2x-avugFnZIZa33zaHWKI8RHWJR6KY,5
|
28
|
+
zenx-0.10.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|