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.
Files changed (26) hide show
  1. {threadmill-0.6.0 → threadmill-0.6.2}/PKG-INFO +1 -1
  2. {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/_version.py +3 -3
  3. threadmill-0.6.2/threadmill/apps.py +8 -0
  4. {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/executor.py +2 -0
  5. threadmill-0.6.2/threadmill/signals.py +10 -0
  6. {threadmill-0.6.0 → threadmill-0.6.2}/LICENSE +0 -0
  7. {threadmill-0.6.0 → threadmill-0.6.2}/README.md +0 -0
  8. {threadmill-0.6.0 → threadmill-0.6.2}/pyproject.toml +1 -1
  9. {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/__init__.py +0 -0
  10. {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/backends/__init__.py +0 -0
  11. {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/backends/base.py +0 -0
  12. {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/backends/lua/acknowledge.lua +0 -0
  13. {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/backends/lua/acquire.lua +0 -0
  14. {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/backends/lua/mover.lua +0 -0
  15. {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/backends/lua/reaper.lua +0 -0
  16. {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/backends/redis.py +0 -0
  17. {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/exceptions.py +0 -0
  18. {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/inspector/__init__.py +0 -0
  19. {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/inspector/app.py +0 -0
  20. {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/inspector/inspector.scss +0 -0
  21. {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/inspector/screens.py +0 -0
  22. {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/inspector/telemetry.py +0 -0
  23. {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/management/__init__.py +0 -0
  24. {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/management/commands/__init__.py +0 -0
  25. {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/management/commands/threadmill.py +0 -0
  26. {threadmill-0.6.0 → threadmill-0.6.2}/threadmill/retry.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: threadmill
3
- Version: 0.6.0
3
+ Version: 0.6.2
4
4
  Summary: The most reliable backend for Django's task framework.
5
5
  Keywords: Django,tasks,worker
6
6
  Author-email: Johannes Maron <johannes@maron.family>
@@ -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.0'
22
- __version_tuple__ = version_tuple = (0, 6, 0)
21
+ __version__ = version = '0.6.2'
22
+ __version_tuple__ = version_tuple = (0, 6, 2)
23
23
 
24
- __commit_id__ = commit_id = 'g2842de1d6'
24
+ __commit_id__ = commit_id = 'g9ded4014b'
@@ -0,0 +1,8 @@
1
+ from django.apps import AppConfig
2
+
3
+
4
+ class ThreadmillConfig(AppConfig):
5
+ name = "threadmill"
6
+
7
+ def ready(self) -> None:
8
+ from . import signals # noqa: F401
@@ -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
@@ -98,5 +98,5 @@ ini_options.DJANGO_SETTINGS_MODULE = "tests.testapp.settings"
98
98
 
99
99
  [tool.coverage]
100
100
  run.source = [ "threadmill" ]
101
- report.show_missing = true
102
101
  report.skip_covered = true
102
+ report.show_missing = true