queue-local 0.0.60__tar.gz → 0.0.62__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.
- {queue_local-0.0.60 → queue_local-0.0.62}/PKG-INFO +1 -1
- {queue_local-0.0.60 → queue_local-0.0.62}/pyproject.toml +1 -1
- {queue_local-0.0.60 → queue_local-0.0.62}/queue_local/src/database_queue.py +6 -8
- {queue_local-0.0.60 → queue_local-0.0.62}/queue_local.egg-info/PKG-INFO +1 -1
- {queue_local-0.0.60 → queue_local-0.0.62}/setup.py +1 -1
- {queue_local-0.0.60 → queue_local-0.0.62}/README.md +0 -0
- {queue_local-0.0.60 → queue_local-0.0.62}/queue_local/src/__init__.py +0 -0
- {queue_local-0.0.60 → queue_local-0.0.62}/queue_local/src/our_queue.py +0 -0
- {queue_local-0.0.60 → queue_local-0.0.62}/queue_local.egg-info/SOURCES.txt +0 -0
- {queue_local-0.0.60 → queue_local-0.0.62}/queue_local.egg-info/dependency_links.txt +0 -0
- {queue_local-0.0.60 → queue_local-0.0.62}/queue_local.egg-info/requires.txt +0 -0
- {queue_local-0.0.60 → queue_local-0.0.62}/queue_local.egg-info/top_level.txt +0 -0
- {queue_local-0.0.60 → queue_local-0.0.62}/setup.cfg +0 -0
|
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
|
|
|
6
6
|
|
|
7
7
|
[tool.poetry]
|
|
8
8
|
name = "queue-local"
|
|
9
|
-
version = "0.0.
|
|
9
|
+
version = "0.0.1" # https://pypi.org/project/queue-local
|
|
10
10
|
description = "queue-local Python Package"
|
|
11
11
|
readme = "README.md"
|
|
12
12
|
authors = [
|
|
@@ -65,8 +65,8 @@ class DatabaseQueue(OurQueue, GenericCRUD, metaclass=MetaLogger, object=queue_lo
|
|
|
65
65
|
is_test_data=is_test_data)
|
|
66
66
|
self.user_context = UserContext()
|
|
67
67
|
|
|
68
|
-
def push(self,
|
|
69
|
-
queue_dict=queue_dict or
|
|
68
|
+
def push(self, queue_data_dict: dict = None, queue_dict: dict = None) -> int:
|
|
69
|
+
queue_dict=queue_dict or queue_data_dict
|
|
70
70
|
"""Pushes a new entry to the queue and returns the new queue id.
|
|
71
71
|
queue_dict consists of columns and values to insert into the queue table."""
|
|
72
72
|
created_user_id = UserContext().get_effective_user_id()
|
|
@@ -84,18 +84,17 @@ class DatabaseQueue(OurQueue, GenericCRUD, metaclass=MetaLogger, object=queue_lo
|
|
|
84
84
|
queue_id = column_value
|
|
85
85
|
else:
|
|
86
86
|
queue_id = self.insert(data_dict=queue_dict)
|
|
87
|
-
self.logger.end("...", object={'push_result': queue_id} )
|
|
88
87
|
return queue_id
|
|
89
88
|
# TODO Can we do this everywhere? [I will make it auto in the meta logger]
|
|
90
89
|
|
|
91
90
|
|
|
92
|
-
def push_back(self, queue_item: dict = None,
|
|
91
|
+
def push_back(self, queue_item: dict = None, queue_dict: dict = None) -> None:
|
|
93
92
|
"""Push a taken queue item back to the queue."""
|
|
94
|
-
queue_dict = queue_item or
|
|
93
|
+
queue_dict = queue_item or queue_dict
|
|
95
94
|
queue_dict = {"queue_status_id": QueueStatusEnum.NEW.value, "process_id": None}
|
|
96
|
-
self.update_by_column_and_value(column_value=queue_item[self.queue_item_id_column_name],
|
|
95
|
+
self.update_by_column_and_value(column_value=queue_item[self.queue_item_id_column_name], data_dict=queue_dict)
|
|
97
96
|
|
|
98
|
-
def get(self, *, action_ids: tuple = (), custom_condition: str = "",data_dict: dict = None, queue_dict: dict = None) -> dict:
|
|
97
|
+
def get(self, *, action_ids: tuple = (), custom_condition: str = "", data_dict: dict = None, queue_dict: dict = None) -> dict:
|
|
99
98
|
"""
|
|
100
99
|
Returns the first item from the queue (possibly considering specific actions) and marks it as taken.
|
|
101
100
|
|
|
@@ -105,7 +104,6 @@ class DatabaseQueue(OurQueue, GenericCRUD, metaclass=MetaLogger, object=queue_lo
|
|
|
105
104
|
"""
|
|
106
105
|
queue_dict=data_dict or queue_dict
|
|
107
106
|
action_ids = self._fix_action_ids(action_ids)
|
|
108
|
-
|
|
109
107
|
queue_dict = {"process_id": os.getpid()}
|
|
110
108
|
update_where = f"process_id IS NULL " \
|
|
111
109
|
f"AND (queue_status_id IS NULL OR queue_status_id = {QueueStatusEnum.NEW.value}) " \
|
|
@@ -5,7 +5,7 @@ package_dir = PACKAGE_NAME.replace("-", "_")
|
|
|
5
5
|
|
|
6
6
|
setuptools.setup(
|
|
7
7
|
name=PACKAGE_NAME, # https://pypi.org/project/queue-local
|
|
8
|
-
version='0.0.
|
|
8
|
+
version='0.0.62',
|
|
9
9
|
author="Circles",
|
|
10
10
|
author_email="info@circles.life",
|
|
11
11
|
url=f"https://github.com/circles-zone/{PACKAGE_NAME}-python-package",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|