python3-cyberfusion-queue-support 3.3.2__py3-none-any.whl → 4.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.
- cyberfusion/QueueSupport/__init__.py +13 -2
- cyberfusion/QueueSupport/database.py +6 -0
- cyberfusion/QueueSupport/items/mkdir.py +0 -2
- cyberfusion/QueueSupport/migrations/versions/19e77347a42d_queue_items_add_started_ended__at.py +29 -0
- {python3_cyberfusion_queue_support-3.3.2.dist-info → python3_cyberfusion_queue_support-4.0.dist-info}/METADATA +5 -5
- {python3_cyberfusion_queue_support-3.3.2.dist-info → python3_cyberfusion_queue_support-4.0.dist-info}/RECORD +9 -8
- {python3_cyberfusion_queue_support-3.3.2.dist-info → python3_cyberfusion_queue_support-4.0.dist-info}/WHEEL +1 -1
- {python3_cyberfusion_queue_support-3.3.2.dist-info → python3_cyberfusion_queue_support-4.0.dist-info}/entry_points.txt +0 -0
- {python3_cyberfusion_queue_support-3.3.2.dist-info → python3_cyberfusion_queue_support-4.0.dist-info}/top_level.txt +0 -0
|
@@ -16,6 +16,7 @@ from cyberfusion.QueueSupport.enums import QueueProcessStatus
|
|
|
16
16
|
|
|
17
17
|
from cyberfusion.QueueSupport.interfaces import OutcomeInterface
|
|
18
18
|
from cyberfusion.QueueSupport.items import _Item
|
|
19
|
+
from datetime import datetime, UTC
|
|
19
20
|
|
|
20
21
|
logger = logging.getLogger(__name__)
|
|
21
22
|
|
|
@@ -72,6 +73,8 @@ class Queue:
|
|
|
72
73
|
deduplicated=deduplicated,
|
|
73
74
|
attributes=item,
|
|
74
75
|
traceback=None,
|
|
76
|
+
started_at=None,
|
|
77
|
+
ended_at=None,
|
|
75
78
|
)
|
|
76
79
|
|
|
77
80
|
self._database_session.add(object_)
|
|
@@ -95,6 +98,10 @@ class Queue:
|
|
|
95
98
|
for item_mapping in self.item_mappings
|
|
96
99
|
if not item_mapping.database_object.deduplicated
|
|
97
100
|
]:
|
|
101
|
+
started_at = datetime.now(UTC)
|
|
102
|
+
|
|
103
|
+
item_mapping.database_object.started_at = started_at
|
|
104
|
+
|
|
98
105
|
logger.debug(
|
|
99
106
|
"Processing item with ID '%s'", item_mapping.database_object.id
|
|
100
107
|
)
|
|
@@ -123,14 +130,18 @@ class Queue:
|
|
|
123
130
|
|
|
124
131
|
item_mapping.database_object.traceback = traceback.format_exc()
|
|
125
132
|
|
|
126
|
-
self._database_session.add(item_mapping.database_object)
|
|
127
|
-
|
|
128
133
|
if item_mapping.database_object.fail_silently:
|
|
129
134
|
process_object.status = QueueProcessStatus.WARNING
|
|
130
135
|
else:
|
|
131
136
|
process_object.status = QueueProcessStatus.FATAL
|
|
132
137
|
|
|
133
138
|
break
|
|
139
|
+
finally:
|
|
140
|
+
ended_at = datetime.now(UTC)
|
|
141
|
+
|
|
142
|
+
item_mapping.database_object.ended_at = ended_at
|
|
143
|
+
|
|
144
|
+
self._database_session.add(item_mapping.database_object)
|
|
134
145
|
|
|
135
146
|
outcomes.extend(item_outcomes)
|
|
136
147
|
|
|
@@ -155,6 +155,12 @@ class QueueItem(BaseModel):
|
|
|
155
155
|
traceback: Mapped[Optional[str]] = mapped_column(
|
|
156
156
|
String(),
|
|
157
157
|
)
|
|
158
|
+
started_at: Mapped[Optional[datetime]] = mapped_column(
|
|
159
|
+
DateTime,
|
|
160
|
+
)
|
|
161
|
+
ended_at: Mapped[Optional[datetime]] = mapped_column(
|
|
162
|
+
DateTime,
|
|
163
|
+
)
|
|
158
164
|
|
|
159
165
|
queue: Mapped["Queue"] = relationship(
|
|
160
166
|
"Queue", back_populates="queue_items", uselist=False
|
|
@@ -22,14 +22,12 @@ class MkdirItem(_Item):
|
|
|
22
22
|
self,
|
|
23
23
|
*,
|
|
24
24
|
path: str,
|
|
25
|
-
recursively: bool = False,
|
|
26
25
|
reference: Optional[str] = None,
|
|
27
26
|
hide_outcomes: bool = False,
|
|
28
27
|
fail_silently: bool = False,
|
|
29
28
|
) -> None:
|
|
30
29
|
"""Set attributes."""
|
|
31
30
|
self.path = path
|
|
32
|
-
self.recursively = recursively
|
|
33
31
|
self._reference = reference
|
|
34
32
|
self._hide_outcomes = hide_outcomes
|
|
35
33
|
self._fail_silently = fail_silently
|
cyberfusion/QueueSupport/migrations/versions/19e77347a42d_queue_items_add_started_ended__at.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""Queue items: add {started,ended}_at
|
|
2
|
+
|
|
3
|
+
Revision ID: 19e77347a42d
|
|
4
|
+
Revises: 93c79cb2baba
|
|
5
|
+
Create Date: 2026-02-20 13:32:09.803951
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from alembic import op
|
|
10
|
+
import sqlalchemy as sa
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# revision identifiers, used by Alembic.
|
|
14
|
+
revision = "19e77347a42d"
|
|
15
|
+
down_revision = "93c79cb2baba"
|
|
16
|
+
branch_labels = None
|
|
17
|
+
depends_on = None
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def upgrade() -> None:
|
|
21
|
+
with op.batch_alter_table("queue_items", schema=None) as batch_op:
|
|
22
|
+
batch_op.add_column(sa.Column("started_at", sa.DateTime(), nullable=True))
|
|
23
|
+
batch_op.add_column(sa.Column("ended_at", sa.DateTime(), nullable=True))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def downgrade() -> None:
|
|
27
|
+
with op.batch_alter_table("queue_items", schema=None) as batch_op:
|
|
28
|
+
batch_op.drop_column("ended_at")
|
|
29
|
+
batch_op.drop_column("started_at")
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python3-cyberfusion-queue-support
|
|
3
|
-
Version:
|
|
3
|
+
Version: 4.0
|
|
4
4
|
Summary: Library to queue actions.
|
|
5
5
|
Author-email: Cyberfusion <support@cyberfusion.io>
|
|
6
6
|
Project-URL: Source, https://github.com/CyberfusionIO/python3-cyberfusion-queue-support
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
8
|
Requires-Dist: python3-cyberfusion-systemd-support~=2.2
|
|
9
|
-
Requires-Dist: python3-cyberfusion-database-support~=3.
|
|
10
|
-
Requires-Dist: alembic==1.
|
|
11
|
-
Requires-Dist: SQLAlchemy==2.0.
|
|
12
|
-
Requires-Dist: pydantic-settings==2.
|
|
9
|
+
Requires-Dist: python3-cyberfusion-database-support~=3.3.0
|
|
10
|
+
Requires-Dist: alembic==1.18.4
|
|
11
|
+
Requires-Dist: SQLAlchemy==2.0.46
|
|
12
|
+
Requires-Dist: pydantic-settings==2.13.1
|
|
13
13
|
|
|
14
14
|
# python3-cyberfusion-queue-support
|
|
15
15
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
cyberfusion/QueueSupport/__init__.py,sha256=
|
|
2
|
-
cyberfusion/QueueSupport/database.py,sha256=
|
|
1
|
+
cyberfusion/QueueSupport/__init__.py,sha256=74xbknQOQRDfgKjMnguMbuwiDZqMjomO_5-hC0Gv7KQ,5181
|
|
2
|
+
cyberfusion/QueueSupport/database.py,sha256=EnYdhiPR4ms8izpjKqzBu-pRMr9duNatNrGkQDo4fHw,5552
|
|
3
3
|
cyberfusion/QueueSupport/encoders.py,sha256=SzuMoyr2q3ME8LI_bZtpP76Xg7SP0B4O4uUuywrDwBI,1532
|
|
4
4
|
cyberfusion/QueueSupport/enums.py,sha256=XzOy5J4sa7SOCKNFyw9kw3MyqDkjPookbfiMQHRHGfQ,122
|
|
5
5
|
cyberfusion/QueueSupport/interfaces.py,sha256=ip8z6cfLFldQCDSec6fK6AIOdxOjIyFykDv4dCHJYSI,943
|
|
@@ -19,7 +19,7 @@ cyberfusion/QueueSupport/items/database_user_drop.py,sha256=KrWbRYD7CzoxkHVVo82g
|
|
|
19
19
|
cyberfusion/QueueSupport/items/database_user_ensure_state.py,sha256=kJC6be3bnWuw-yKhb2BqIumAXPMRvyPgIu4Rt4timE4,3022
|
|
20
20
|
cyberfusion/QueueSupport/items/database_user_grant_grant.py,sha256=hZ6xv0CSBrCcxjX5OKje66CnzCDGp8Melx-JmfZUFc4,3773
|
|
21
21
|
cyberfusion/QueueSupport/items/database_user_grant_revoke.py,sha256=njD8TdEukco4JIg71L-cBYsl2g0Tzt9J6LUd3Xbcd5s,3780
|
|
22
|
-
cyberfusion/QueueSupport/items/mkdir.py,sha256=
|
|
22
|
+
cyberfusion/QueueSupport/items/mkdir.py,sha256=Wi_lEbmhEll2ReAwCRscX6gtyG7j0D2RVMFl0QRv7UA,1805
|
|
23
23
|
cyberfusion/QueueSupport/items/move.py,sha256=0JzuQdQ7DU3jXmF0xziE8G_SXQqQsWI95QUVWva11zM,1750
|
|
24
24
|
cyberfusion/QueueSupport/items/rmtree.py,sha256=WtrdU8ehE2oT43RCYaUQhW2amZKSt1_Oxy5op5bMrHU,2007
|
|
25
25
|
cyberfusion/QueueSupport/items/systemd_daemon_reload.py,sha256=MTHp3ypnyFh5y23lYKKS8wCLHQ4-HRRstImStubpPXE,1363
|
|
@@ -34,6 +34,7 @@ cyberfusion/QueueSupport/items/unlink.py,sha256=SEPAt53ANilygrvo4LriXZoDBbv1BNXs
|
|
|
34
34
|
cyberfusion/QueueSupport/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
35
35
|
cyberfusion/QueueSupport/migrations/env.py,sha256=ieFeyGnY5ZhsV9MTQNum8O9DTVFR_xrxPM_BvaD9dKo,1203
|
|
36
36
|
cyberfusion/QueueSupport/migrations/versions/03d4e411c575_add_fail_silently.py,sha256=ObiRDaK-Dp4GstAYIjZQEbTWGPtJ7XQsVb6d4x1n87k,570
|
|
37
|
+
cyberfusion/QueueSupport/migrations/versions/19e77347a42d_queue_items_add_started_ended__at.py,sha256=ugw7IPdUvLy9w4eUKQQIPt6lhZfGICl7twL6LGlfWy8,762
|
|
37
38
|
cyberfusion/QueueSupport/migrations/versions/2f4316506856_add_cascade_deletes.py,sha256=WqLQFTrsaPpYSSMvj8FepWyhSm_icmIk8ijX2So7tYk,1936
|
|
38
39
|
cyberfusion/QueueSupport/migrations/versions/52d1b17abcd0_add_status.py,sha256=gmQun_HQNtwB7L7YMPyimT0jE2qe6xCO7cc6V6PCg1k,605
|
|
39
40
|
cyberfusion/QueueSupport/migrations/versions/571e55ab5ed5_initial_migration.py,sha256=1yYFZhQyHVnn1nHXxLVRb94V7gXprWYMfIDhF0_DPVU,2845
|
|
@@ -44,8 +45,8 @@ cyberfusion/QueueSupport/migrations/versions/9ae29b5db790_add_string_to_queue_it
|
|
|
44
45
|
cyberfusion/QueueSupport/migrations/versions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
45
46
|
cyberfusion/QueueSupport/scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
46
47
|
cyberfusion/QueueSupport/scripts/purge_queues.py,sha256=W1-p85YhAJhJfHIPQrS0KVgrLMzWPlGniDTZ_dSma_w,473
|
|
47
|
-
python3_cyberfusion_queue_support-
|
|
48
|
-
python3_cyberfusion_queue_support-
|
|
49
|
-
python3_cyberfusion_queue_support-
|
|
50
|
-
python3_cyberfusion_queue_support-
|
|
51
|
-
python3_cyberfusion_queue_support-
|
|
48
|
+
python3_cyberfusion_queue_support-4.0.dist-info/METADATA,sha256=NDXrrzhQ9qFq0a9H1uhHJH4WBQNr1TeD7cGlX3HkkeQ,4623
|
|
49
|
+
python3_cyberfusion_queue_support-4.0.dist-info/WHEEL,sha256=YCfwYGOYMi5Jhw2fU4yNgwErybb2IX5PEwBKV4ZbdBo,91
|
|
50
|
+
python3_cyberfusion_queue_support-4.0.dist-info/entry_points.txt,sha256=z7WykKo9hbm5I1iMbHIearPGdkGemhQnSkl7a44zMDY,171
|
|
51
|
+
python3_cyberfusion_queue_support-4.0.dist-info/top_level.txt,sha256=ss011q9S6SL_KIIyq7iujFmIYa0grSjlnInO7cDkeag,12
|
|
52
|
+
python3_cyberfusion_queue_support-4.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|