educommon 3.9.10__py3-none-any.whl → 3.10.0__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.
- educommon/async_task/tasks.py +36 -0
- educommon/version.conf +5 -5
- {educommon-3.9.10.dist-info → educommon-3.10.0.dist-info}/METADATA +1 -1
- {educommon-3.9.10.dist-info → educommon-3.10.0.dist-info}/RECORD +7 -7
- {educommon-3.9.10.dist-info → educommon-3.10.0.dist-info}/WHEEL +1 -1
- {educommon-3.9.10.dist-info → educommon-3.10.0.dist-info}/dependency_links.txt +0 -0
- {educommon-3.9.10.dist-info → educommon-3.10.0.dist-info}/top_level.txt +0 -0
educommon/async_task/tasks.py
CHANGED
@@ -12,6 +12,9 @@ from celery import (
|
|
12
12
|
states,
|
13
13
|
Task,
|
14
14
|
)
|
15
|
+
from celery.exceptions import (
|
16
|
+
Ignore,
|
17
|
+
)
|
15
18
|
from celery.schedules import (
|
16
19
|
maybe_schedule,
|
17
20
|
)
|
@@ -328,3 +331,36 @@ class PeriodicAsyncTask(AsyncTask):
|
|
328
331
|
'options': cls.options or {},
|
329
332
|
'relative': cls.relative,
|
330
333
|
}
|
334
|
+
|
335
|
+
|
336
|
+
class PeriodicTaskLocker(TaskLocker):
|
337
|
+
"""Класс отвечающий за блокировку задач.
|
338
|
+
|
339
|
+
Переопределён для возможности игнорирования повторного запуска для уже
|
340
|
+
запущенных периодических задач.
|
341
|
+
"""
|
342
|
+
|
343
|
+
def raise_if_locked(self, message: Optional[str] = None):
|
344
|
+
"""Если блокировано, то вызывает исключение."""
|
345
|
+
if self.is_locked():
|
346
|
+
self.debug(f'Add failed. Task {self.task_name} currently locked ({self.params})')
|
347
|
+
|
348
|
+
raise Ignore()
|
349
|
+
|
350
|
+
|
351
|
+
class UniquePeriodicAsyncTask(PeriodicAsyncTask):
|
352
|
+
"""Уникальные периодические задачи."""
|
353
|
+
|
354
|
+
abstract = True
|
355
|
+
lock_expire_seconds = 60 * 60
|
356
|
+
|
357
|
+
locker_class = PeriodicTaskLocker
|
358
|
+
|
359
|
+
@property
|
360
|
+
def locker_config(self) -> dict:
|
361
|
+
"""Настройки для механизма блокировок. """
|
362
|
+
return {
|
363
|
+
'lock_params': {'task_name': self.name},
|
364
|
+
'lock_message': f'Task [{self.__name__}] is running',
|
365
|
+
'lock_expire': self.lock_expire_seconds,
|
366
|
+
}
|
educommon/version.conf
CHANGED
@@ -4,8 +4,8 @@
|
|
4
4
|
# нормальной установки обновлений.
|
5
5
|
|
6
6
|
[version]
|
7
|
-
BRANCH = tags/3.
|
8
|
-
VERSION = 3.
|
9
|
-
REVISION =
|
10
|
-
VERSION_DATE =
|
11
|
-
REVISION_DATE =
|
7
|
+
BRANCH = tags/3.10.0^0
|
8
|
+
VERSION = 3.10.0
|
9
|
+
REVISION = b22dda296d7f58eb45bb87633d1a1d4b45afe36b
|
10
|
+
VERSION_DATE = 27.08.2024
|
11
|
+
REVISION_DATE = 27.08.2024
|
@@ -1,6 +1,6 @@
|
|
1
1
|
educommon/__init__.py,sha256=fvsBDL7g8HgOTd-JHOh7TSvMcnUauvGVgPuyA2Z9hUI,419
|
2
2
|
educommon/thread_data.py,sha256=n0XtdesP9H92O3rJ8K6fVnJLiHqyJEfh2xpuT36wzxs,61
|
3
|
-
educommon/version.conf,sha256=
|
3
|
+
educommon/version.conf,sha256=GEc3p9Cz8yLJMP33CoXa2gpl4l7N-Dv8Rdbzq8JeLPA,452
|
4
4
|
educommon/about/README.rst,sha256=U48UW5jv-8qHyaV56atzzkNMvzHKXVcWSb_NR06PnMo,2685
|
5
5
|
educommon/about/__init__.py,sha256=H1W0IgW-qX9LCZ49GOJzHdmQGHhh-MA6U1xmNx7WnfM,132
|
6
6
|
educommon/about/apps.py,sha256=GrpJAOE2sF0ukWsqugP_WJS88DO4aL-T3kTLprrJrcA,259
|
@@ -21,7 +21,7 @@ educommon/async_task/exceptions.py,sha256=PaaG2nqP0G2eZ-p0yssca2hhxIccil6MYKH6Zt
|
|
21
21
|
educommon/async_task/helpers.py,sha256=HihuIHrszhVQAb-Cs6-l4npnlNAgctItGBJ-oIPQX74,2706
|
22
22
|
educommon/async_task/locker.py,sha256=TwVFhuEGsK0JHPXsWuqx7t2Op2mUKETY5EvHSeuKjc8,3844
|
23
23
|
educommon/async_task/models.py,sha256=pICrDFr4Vq6KWpa28NIALP45aLs0lqP7YC2p1IQDFSc,7430
|
24
|
-
educommon/async_task/tasks.py,sha256=
|
24
|
+
educommon/async_task/tasks.py,sha256=T0INbjknXspeMleUkxPSGwJoKJy1_ZSDed4kbQ-RK44,12929
|
25
25
|
educommon/async_task/ui.py,sha256=LD7RwM4-6M_6ZO3Ulwy6_lK7rDPcddg-gB6EOV65494,5829
|
26
26
|
educommon/async_task/migrations/0001_initial.py,sha256=W0HfBmhatmQ7Dy4giGeqaZNtLHiEVAvJqx0AvHaxGZ0,3677
|
27
27
|
educommon/async_task/migrations/0002_task_type_and_status_data.py,sha256=rDGxKnbwu4OqfcodFwA_TR-kfDGRKJhivEBFKuurM30,3359
|
@@ -344,8 +344,8 @@ educommon/ws_log/smev/exceptions.py,sha256=lmy7o2T3dJkqgIhG07qyh5yPqO3qZAYABuT4J
|
|
344
344
|
educommon/ws_log/templates/report/smev_logs.xlsx,sha256=nnYgB0Z_ix8HoxsRICjsZfFRQBdra-5Gd8nWhCxTjYg,10439
|
345
345
|
educommon/ws_log/templates/ui-js/smev-logs-list-window.js,sha256=AGup3D8GTJSY9WdDPj0zBJeYQBFOmGgcbxPOJbKK-nY,513
|
346
346
|
educommon/ws_log/templates/ui-js/smev-logs-report-setting-window.js,sha256=nQ7QYK9frJcE7g7kIt6INg9TlEEJAPPayBJgRaoTePA,1103
|
347
|
-
educommon-3.
|
348
|
-
educommon-3.
|
349
|
-
educommon-3.
|
350
|
-
educommon-3.
|
351
|
-
educommon-3.
|
347
|
+
educommon-3.10.0.dist-info/METADATA,sha256=-bS0yfIclXtDEmBJDKnsIjTI7LKXKQnThnbmAZjjA4g,1563
|
348
|
+
educommon-3.10.0.dist-info/WHEEL,sha256=Mdi9PDNwEZptOjTlUcAth7XJDFtKrHYaQMPulZeBCiQ,91
|
349
|
+
educommon-3.10.0.dist-info/dependency_links.txt,sha256=RNlr4t-BxZRm7e_IfVo1ikr5ln-7viimzLHvQMO1C_Q,43
|
350
|
+
educommon-3.10.0.dist-info/top_level.txt,sha256=z5fbW7bz_0V1foUm_FGcZ9_MTpW3N1dBN7-kEmMowl4,10
|
351
|
+
educommon-3.10.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|