jararaca 0.3.12a2__py3-none-any.whl → 0.3.12a3__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.
Potentially problematic release.
This version of jararaca might be problematic. Click here for more details.
- jararaca/scheduler/beat_worker.py +14 -6
- {jararaca-0.3.12a2.dist-info → jararaca-0.3.12a3.dist-info}/METADATA +1 -1
- {jararaca-0.3.12a2.dist-info → jararaca-0.3.12a3.dist-info}/RECORD +7 -7
- pyproject.toml +1 -1
- {jararaca-0.3.12a2.dist-info → jararaca-0.3.12a3.dist-info}/LICENSE +0 -0
- {jararaca-0.3.12a2.dist-info → jararaca-0.3.12a3.dist-info}/WHEEL +0 -0
- {jararaca-0.3.12a2.dist-info → jararaca-0.3.12a3.dist-info}/entry_points.txt +0 -0
|
@@ -5,7 +5,6 @@ import signal
|
|
|
5
5
|
import time
|
|
6
6
|
from abc import ABC, abstractmethod
|
|
7
7
|
from datetime import UTC, datetime
|
|
8
|
-
from types import FrameType
|
|
9
8
|
from typing import Any
|
|
10
9
|
from urllib.parse import parse_qs
|
|
11
10
|
|
|
@@ -249,13 +248,16 @@ class BeatWorker:
|
|
|
249
248
|
|
|
250
249
|
def run(self) -> None:
|
|
251
250
|
|
|
252
|
-
def
|
|
253
|
-
logger.info("
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
signal.signal(signal.SIGINT, on_signal_received)
|
|
251
|
+
def on_shutdown(loop: asyncio.AbstractEventLoop) -> None:
|
|
252
|
+
logger.info("Shutting down - signal received")
|
|
253
|
+
# Schedule the shutdown to run in the event loop
|
|
254
|
+
asyncio.create_task(self._graceful_shutdown())
|
|
257
255
|
|
|
258
256
|
with asyncio.Runner(loop_factory=uvloop.new_event_loop) as runner:
|
|
257
|
+
loop = runner.get_loop()
|
|
258
|
+
loop.add_signal_handler(signal.SIGINT, on_shutdown, loop)
|
|
259
|
+
# Add graceful shutdown handler for SIGTERM as well
|
|
260
|
+
loop.add_signal_handler(signal.SIGTERM, on_shutdown, loop)
|
|
259
261
|
runner.run(self.start_scheduler())
|
|
260
262
|
|
|
261
263
|
async def start_scheduler(self) -> None:
|
|
@@ -340,3 +342,9 @@ class BeatWorker:
|
|
|
340
342
|
|
|
341
343
|
await self.backend.dispose()
|
|
342
344
|
await self.broker.dispose()
|
|
345
|
+
|
|
346
|
+
async def _graceful_shutdown(self) -> None:
|
|
347
|
+
"""Handles graceful shutdown process"""
|
|
348
|
+
logger.info("Initiating graceful shutdown sequence")
|
|
349
|
+
self.shutdown_event.set()
|
|
350
|
+
logger.info("Graceful shutdown completed")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
2
2
|
README.md,sha256=2qMM__t_MoLKZr4IY9tXjo-Jn6LKjuHMb1qbyXpgL08,3401
|
|
3
|
-
pyproject.toml,sha256=
|
|
3
|
+
pyproject.toml,sha256=Hiy7cJKBQIrdiYnBskiQEYruLl8LsGgsknkKCD2uSp8,2040
|
|
4
4
|
jararaca/__init__.py,sha256=EdOPigKYraoG7I-Hl9V3XteqrbhdBS3xy1rUakh58lc,17949
|
|
5
5
|
jararaca/__main__.py,sha256=-O3vsB5lHdqNFjUtoELDF81IYFtR-DSiiFMzRaiSsv4,67
|
|
6
6
|
jararaca/broker_backend/__init__.py,sha256=GzEIuHR1xzgCJD4FE3harNjoaYzxHMHoEL0_clUaC-k,3528
|
|
@@ -60,7 +60,7 @@ jararaca/rpc/http/backends/otel.py,sha256=Uc6CjHSCZ5hvnK1fNFv3ota5xzUFnvIl1JOpG3
|
|
|
60
60
|
jararaca/rpc/http/decorators.py,sha256=oUSzgMGI8w6SoKiz3GltDbd3BWAuyY60F23cdRRNeiw,11897
|
|
61
61
|
jararaca/rpc/http/httpx.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
62
62
|
jararaca/scheduler/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
63
|
-
jararaca/scheduler/beat_worker.py,sha256=
|
|
63
|
+
jararaca/scheduler/beat_worker.py,sha256=i_NyovjFhhLYuUivf2mwpVC27oQ9SGTFOHZ7Ec4jv6I,12076
|
|
64
64
|
jararaca/scheduler/decorators.py,sha256=iyWFvPLCRh9c0YReQRemI2mLuaUv7r929So-xuKIWUs,4605
|
|
65
65
|
jararaca/scheduler/types.py,sha256=4HEQOmVIDp-BYLSzqmqSFIio1bd51WFmgFPIzPpVu04,135
|
|
66
66
|
jararaca/tools/app_config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -70,8 +70,8 @@ jararaca/tools/typescript/interface_parser.py,sha256=Bux7DUjEQ8eAry_qZeKCIYz0aPa
|
|
|
70
70
|
jararaca/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
71
71
|
jararaca/utils/rabbitmq_utils.py,sha256=ytdAFUyv-OBkaVnxezuJaJoLrmN7giZgtKeet_IsMBs,10918
|
|
72
72
|
jararaca/utils/retry.py,sha256=DzPX_fXUvTqej6BQ8Mt2dvLo9nNlTBm7Kx2pFZ26P2Q,4668
|
|
73
|
-
jararaca-0.3.
|
|
74
|
-
jararaca-0.3.
|
|
75
|
-
jararaca-0.3.
|
|
76
|
-
jararaca-0.3.
|
|
77
|
-
jararaca-0.3.
|
|
73
|
+
jararaca-0.3.12a3.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
74
|
+
jararaca-0.3.12a3.dist-info/METADATA,sha256=wspP7q-KGhpcjXzXfRPGdW14rjggwwhzGOFnhmhjgDE,4995
|
|
75
|
+
jararaca-0.3.12a3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
76
|
+
jararaca-0.3.12a3.dist-info/entry_points.txt,sha256=WIh3aIvz8LwUJZIDfs4EeH3VoFyCGEk7cWJurW38q0I,45
|
|
77
|
+
jararaca-0.3.12a3.dist-info/RECORD,,
|
pyproject.toml
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|