threadmill 0.6.0__tar.gz → 0.6.2__tar.gz
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.
- {threadmill-0.6.0 → threadmill-0.6.2}/PKG-INFO +1 -1
- {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/_version.py +3 -3
- threadmill-0.6.2/threadmill/apps.py +8 -0
- {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/executor.py +2 -0
- threadmill-0.6.2/threadmill/signals.py +10 -0
- {threadmill-0.6.0 → threadmill-0.6.2}/LICENSE +0 -0
- {threadmill-0.6.0 → threadmill-0.6.2}/README.md +0 -0
- {threadmill-0.6.0 → threadmill-0.6.2}/pyproject.toml +1 -1
- {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/__init__.py +0 -0
- {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/backends/__init__.py +0 -0
- {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/backends/base.py +0 -0
- {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/backends/lua/acknowledge.lua +0 -0
- {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/backends/lua/acquire.lua +0 -0
- {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/backends/lua/mover.lua +0 -0
- {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/backends/lua/reaper.lua +0 -0
- {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/backends/redis.py +0 -0
- {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/exceptions.py +0 -0
- {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/inspector/__init__.py +0 -0
- {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/inspector/app.py +0 -0
- {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/inspector/inspector.scss +0 -0
- {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/inspector/screens.py +0 -0
- {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/inspector/telemetry.py +0 -0
- {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/management/__init__.py +0 -0
- {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/management/commands/__init__.py +0 -0
- {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/management/commands/threadmill.py +0 -0
- {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/retry.py +0 -0
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '0.6.
|
|
22
|
-
__version_tuple__ = version_tuple = (0, 6,
|
|
21
|
+
__version__ = version = '0.6.2'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 6, 2)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'g9ded4014b'
|
|
@@ -15,6 +15,7 @@ from inspect import iscoroutinefunction
|
|
|
15
15
|
from queue import Empty
|
|
16
16
|
from traceback import format_exception
|
|
17
17
|
|
|
18
|
+
import django
|
|
18
19
|
from django.tasks import TaskResult, task_backends
|
|
19
20
|
from django.tasks.base import TaskContext, TaskError, TaskResultStatus
|
|
20
21
|
from django.tasks.signals import task_finished, task_started
|
|
@@ -146,6 +147,7 @@ class WorkerProcess(multiprocessing.Process):
|
|
|
146
147
|
|
|
147
148
|
def run(self) -> None:
|
|
148
149
|
"""Start consumer execution inside this process."""
|
|
150
|
+
django.setup()
|
|
149
151
|
logger.info("Starting worker process %s", self.name)
|
|
150
152
|
self.lock = threading.Lock()
|
|
151
153
|
self.expired = threading.Event()
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from django.db import close_old_connections
|
|
2
|
+
from django.dispatch import receiver
|
|
3
|
+
from django.tasks.signals import task_finished, task_started
|
|
4
|
+
|
|
5
|
+
from .executor import TaskExecutor
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@receiver([task_started, task_finished], sender=TaskExecutor)
|
|
9
|
+
def close_task_database_connection(sender, task_result, **kwargs):
|
|
10
|
+
close_old_connections()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|