Skip to content

Commit 7992390

Browse files
committed
- Minor bugfixes
1 parent 19993ff commit 7992390

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

django-queue-manager/django_queue_manager.egg-info/PKG-INFO

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 1.1
22
Name: django-queue-manager
3-
Version: 1.3.1
3+
Version: 1.3.2
44
Summary: A simple app that provides a Message Queue System using a socket as broker, this app, make you able to manage an ordered queue of tasks (with calling a simple queuing function form API).Simple to setup, easy to manage and scalable, the queue can be remotized to another server,you can use multiple istance of the application, and easly manage multiple broker and relatives queues.This app, will integrate into your DB backend and serves three table with the states of the queue.
55
Home-page: http://www.fardellasimone.com/
66
Author: Fardella Simone

django-queue-manager/django_queue_manager.egg-info/SOURCES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ django_queue_manager.egg-info/PKG-INFO
1717
django_queue_manager.egg-info/SOURCES.txt
1818
django_queue_manager.egg-info/dependency_links.txt
1919
django_queue_manager.egg-info/top_level.txt
20+
django_queue_manager/migrations/0001_initial.py
2021
django_queue_manager/migrations/__init__.py
2122
django_queue_manager/utilities/__init__.py
2223
django_queue_manager/utilities/loggers.py

django-queue-manager/django_queue_manager/worker.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,10 @@ def run(self):
7575
# the queue and move the task into success/failed tasks in base of successful or not execution.
7676
self.logger.info('Worker Thread Starts')
7777
while not self._stopevent.isSet():
78-
if not self.worker_queue.empty():
78+
task = self.worker_queue.get()
79+
if task == None:
80+
break
7981
try:
80-
task = self.worker_queue.get()
8182
self.logger.info('Consuming Task Id: {db_id}'.format(
8283
name=task.task_function_name,
8384
db_id=task.db_id))
@@ -100,16 +101,15 @@ def run(self):
100101
continue
101102

102103
finally:
103-
# In any case, it will dequeue the task form the queued tasks
104-
self.dequeue_task(task=task)
104+
105+
if task:
106+
# In any case, it will dequeue the task form the queued tasks
107+
self.dequeue_task(task=task)
105108

106109
# Close the connection, in order to prevent (2006, 'MySQL server has gone away') timeout error
107110
from django.db import connection
108111
connection.close()
109112

110-
else:
111-
# In order to respect the CPU sleeps for 50 milliseconds when the queue it's empty
112-
time.sleep(0.100)
113113

114114
self.worker_queue = None
115115
self.logger.warning('Worker Thread stopped, {0} tasks handled'.format(self.tasks_counter))

django-queue-manager/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
setup(
1111
name='django-queue-manager',
12-
version='1.3.1',
12+
version='1.3.3',
1313
packages=find_packages(),
1414
include_package_data=True,
1515
license='GNU GPLv3',

0 commit comments

Comments
 (0)