Release d03c7bd7995b3c967ec523eaddf376d5; BugFix for threaded queue (multiple jobs wit identical priority)
This commit is contained in:
parent
9fbd98f39c
commit
c9e1e20764
@ -70,6 +70,7 @@ class queue(object):
|
||||
"""
|
||||
class job(object):
|
||||
def __init__(self, priority, callback, *args, **kwargs):
|
||||
self.time = time.time()
|
||||
self.priority = priority
|
||||
self.callback = callback
|
||||
self.args = args
|
||||
@ -79,7 +80,10 @@ class queue(object):
|
||||
self.callback(queue, *self.args, **self.kwargs)
|
||||
|
||||
def __lt__(self, other):
|
||||
return self.priority < other.priority
|
||||
if self.priority != other.priority:
|
||||
return self.priority < other.priority
|
||||
else:
|
||||
return self.time < other.time
|
||||
|
||||
def __init__(self, expire=True):
|
||||
self.__expire = expire
|
||||
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user