python3-cyberfusion-queue-support 2.6.2__tar.gz → 2.6.4__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.
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/PKG-INFO +1 -1
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/pyproject.toml +1 -1
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/__init__.py +12 -19
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/database.py +30 -11
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/python3_cyberfusion_queue_support.egg-info/PKG-INFO +1 -1
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/README.md +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/setup.cfg +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/encoders.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/exceptions/__init__.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/interfaces.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/items/__init__.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/items/chmod.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/items/chown.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/items/command.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/items/copy.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/items/database_create.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/items/database_drop.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/items/database_user_drop.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/items/database_user_ensure_state.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/items/database_user_grant_grant.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/items/database_user_grant_revoke.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/items/mkdir.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/items/move.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/items/rmtree.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/items/systemd_daemon_reload.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/items/systemd_tmp_files_create.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/items/systemd_unit_disable.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/items/systemd_unit_enable.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/items/systemd_unit_reload.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/items/systemd_unit_restart.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/items/systemd_unit_start.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/items/systemd_unit_stop.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/items/unlink.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/migrations/__init__.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/migrations/env.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/migrations/versions/571e55ab5ed5_initial_migration.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/migrations/versions/8023b9eecdd1_add_traceback_to_queue_items.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/migrations/versions/9ae29b5db790_add_string_to_queue_item_outcomes.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/migrations/versions/__init__.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/outcomes.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/sentinels.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/settings.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/cyberfusion/QueueSupport/utilities.py +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/python3_cyberfusion_queue_support.egg-info/SOURCES.txt +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/python3_cyberfusion_queue_support.egg-info/dependency_links.txt +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/python3_cyberfusion_queue_support.egg-info/entry_points.txt +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/python3_cyberfusion_queue_support.egg-info/requires.txt +0 -0
- {python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/src/python3_cyberfusion_queue_support.egg-info/top_level.txt +0 -0
{python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python3-cyberfusion-queue-support
|
|
3
|
-
Version: 2.6.
|
|
3
|
+
Version: 2.6.4
|
|
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
|
|
@@ -47,22 +47,18 @@ class Queue:
|
|
|
47
47
|
"""Add item to queue."""
|
|
48
48
|
deduplicated = False
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
),
|
|
56
|
-
None,
|
|
57
|
-
)
|
|
50
|
+
existing_items_indexes = [
|
|
51
|
+
index
|
|
52
|
+
for index, item_mapping in enumerate(self.item_mappings)
|
|
53
|
+
if item_mapping.item == item
|
|
54
|
+
]
|
|
58
55
|
|
|
59
|
-
if
|
|
56
|
+
if existing_items_indexes:
|
|
60
57
|
if run_duplicate_last:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
self._database_session.commit()
|
|
58
|
+
for existing_item_index in existing_items_indexes:
|
|
59
|
+
self.item_mappings[
|
|
60
|
+
existing_item_index
|
|
61
|
+
].database_object.deduplicated = True
|
|
66
62
|
else:
|
|
67
63
|
deduplicated = True
|
|
68
64
|
|
|
@@ -82,7 +78,6 @@ class Queue:
|
|
|
82
78
|
)
|
|
83
79
|
|
|
84
80
|
self._database_session.add(object_)
|
|
85
|
-
self._database_session.commit()
|
|
86
81
|
|
|
87
82
|
self.item_mappings.append(QueueItemMapping(item, object_))
|
|
88
83
|
|
|
@@ -96,7 +91,6 @@ class Queue:
|
|
|
96
91
|
)
|
|
97
92
|
|
|
98
93
|
self._database_session.add(process_object)
|
|
99
|
-
self._database_session.commit()
|
|
100
94
|
|
|
101
95
|
outcomes = []
|
|
102
96
|
|
|
@@ -134,7 +128,6 @@ class Queue:
|
|
|
134
128
|
item_mapping.database_object.traceback = traceback.format_exc()
|
|
135
129
|
|
|
136
130
|
self._database_session.add(item_mapping.database_object)
|
|
137
|
-
self._database_session.commit()
|
|
138
131
|
|
|
139
132
|
# Don't fulfill other queue items
|
|
140
133
|
|
|
@@ -153,10 +146,10 @@ class Queue:
|
|
|
153
146
|
)
|
|
154
147
|
)
|
|
155
148
|
|
|
156
|
-
self._database_session.commit()
|
|
157
|
-
|
|
158
149
|
logger.debug("Processed item with ID '%s'", item_mapping.database_object.id)
|
|
159
150
|
|
|
160
151
|
logger.debug("Processed items")
|
|
161
152
|
|
|
153
|
+
self._database_session.commit()
|
|
154
|
+
|
|
162
155
|
return outcomes
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from alembic.config import Config
|
|
2
2
|
import os
|
|
3
|
+
import functools
|
|
3
4
|
from alembic import command
|
|
4
5
|
import sqlite3
|
|
5
6
|
from datetime import datetime, timezone
|
|
@@ -19,15 +20,11 @@ from cyberfusion.QueueSupport.settings import settings
|
|
|
19
20
|
def set_sqlite_pragma(
|
|
20
21
|
dbapi_connection: sqlite3.Connection, connection_record: _ConnectionRecord
|
|
21
22
|
) -> None:
|
|
22
|
-
"""Enable foreign key support.
|
|
23
|
-
|
|
24
|
-
This is needed for cascade deletes to work.
|
|
25
|
-
|
|
26
|
-
See https://docs.sqlalchemy.org/en/13/dialects/sqlite.html#sqlite-foreign-keys
|
|
27
|
-
"""
|
|
28
23
|
cursor = dbapi_connection.cursor()
|
|
29
24
|
|
|
30
25
|
cursor.execute("PRAGMA foreign_keys=ON")
|
|
26
|
+
cursor.execute("PRAGMA journal_mode=WAL")
|
|
27
|
+
cursor.execute("PRAGMA synchronous=NORMAL")
|
|
31
28
|
|
|
32
29
|
cursor.close()
|
|
33
30
|
|
|
@@ -75,7 +72,9 @@ class BaseModel(Base): # type: ignore[misc, valid-type]
|
|
|
75
72
|
__abstract__ = True
|
|
76
73
|
|
|
77
74
|
id = Column(Integer, primary_key=True)
|
|
78
|
-
created_at = Column(
|
|
75
|
+
created_at = Column(
|
|
76
|
+
DateTime, default=functools.partial(datetime.now, timezone.utc), nullable=False
|
|
77
|
+
)
|
|
79
78
|
|
|
80
79
|
|
|
81
80
|
class Queue(BaseModel):
|
|
@@ -83,6 +82,15 @@ class Queue(BaseModel):
|
|
|
83
82
|
|
|
84
83
|
__tablename__ = "queues"
|
|
85
84
|
|
|
85
|
+
queue_items = relationship(
|
|
86
|
+
"QueueItem",
|
|
87
|
+
back_populates="queue",
|
|
88
|
+
)
|
|
89
|
+
queue_processes = relationship(
|
|
90
|
+
"QueueProcess",
|
|
91
|
+
back_populates="queue",
|
|
92
|
+
)
|
|
93
|
+
|
|
86
94
|
|
|
87
95
|
class QueueProcess(BaseModel):
|
|
88
96
|
"""QueueProcess model."""
|
|
@@ -90,9 +98,14 @@ class QueueProcess(BaseModel):
|
|
|
90
98
|
__tablename__ = "queue_processes"
|
|
91
99
|
|
|
92
100
|
queue_id = Column(Integer, ForeignKey("queues.id"), nullable=False)
|
|
93
|
-
queue = relationship("Queue")
|
|
94
101
|
preview = Column(Boolean, nullable=False)
|
|
95
102
|
|
|
103
|
+
queue = relationship("Queue", back_populates="queue_processes")
|
|
104
|
+
queue_item_outcomes = relationship(
|
|
105
|
+
"QueueItemOutcome",
|
|
106
|
+
back_populates="queue_process",
|
|
107
|
+
)
|
|
108
|
+
|
|
96
109
|
|
|
97
110
|
class QueueItem(BaseModel):
|
|
98
111
|
"""QueueItem model."""
|
|
@@ -100,7 +113,6 @@ class QueueItem(BaseModel):
|
|
|
100
113
|
__tablename__ = "queue_items"
|
|
101
114
|
|
|
102
115
|
queue_id = Column(Integer, ForeignKey("queues.id"), nullable=False)
|
|
103
|
-
queue = relationship("Queue")
|
|
104
116
|
type = Column(String(length=255), nullable=False)
|
|
105
117
|
reference = Column(String(length=255), nullable=True)
|
|
106
118
|
hide_outcomes = Column(Boolean, nullable=False)
|
|
@@ -108,6 +120,12 @@ class QueueItem(BaseModel):
|
|
|
108
120
|
attributes = Column(JSON, nullable=False)
|
|
109
121
|
traceback = Column(String(), nullable=True)
|
|
110
122
|
|
|
123
|
+
queue = relationship("Queue", back_populates="queue_items")
|
|
124
|
+
queue_item_outcomes = relationship(
|
|
125
|
+
"QueueItemOutcome",
|
|
126
|
+
back_populates="queue_item",
|
|
127
|
+
)
|
|
128
|
+
|
|
111
129
|
|
|
112
130
|
class QueueItemOutcome(BaseModel):
|
|
113
131
|
"""QueueItemOutcome model."""
|
|
@@ -115,9 +133,10 @@ class QueueItemOutcome(BaseModel):
|
|
|
115
133
|
__tablename__ = "queue_item_outcomes"
|
|
116
134
|
|
|
117
135
|
queue_item_id = Column(Integer, ForeignKey("queue_items.id"), nullable=False)
|
|
118
|
-
queue_item = relationship("QueueItem")
|
|
119
136
|
queue_process_id = Column(Integer, ForeignKey("queue_processes.id"), nullable=False)
|
|
120
|
-
queue_process = relationship("QueueProcess")
|
|
121
137
|
type = Column(String(length=255), nullable=False)
|
|
122
138
|
attributes = Column(JSON, nullable=False)
|
|
123
139
|
string = Column(String(length=255), nullable=False)
|
|
140
|
+
|
|
141
|
+
queue_item = relationship("QueueItem", back_populates="queue_item_outcomes")
|
|
142
|
+
queue_process = relationship("QueueProcess", back_populates="queue_item_outcomes")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python3-cyberfusion-queue-support
|
|
3
|
-
Version: 2.6.
|
|
3
|
+
Version: 2.6.4
|
|
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
|
{python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/README.md
RENAMED
|
File without changes
|
{python3_cyberfusion_queue_support-2.6.2 → python3_cyberfusion_queue_support-2.6.4}/setup.cfg
RENAMED
|
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
|
|
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
|
|
File without changes
|