Release d03c7bd7995b3c967ec523eaddf376d5; BugFix for threaded queue (multiple jobs wit identical priority)
This commit is contained in:
부모
9fbd98f39c
커밋
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
|
||||
|
파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
Load Diff
Binary file not shown.
불러오는 중...
x
Reference in New Issue
Block a user