Add :mono to disable multithreading
Convenient to have linear logging
This commit is contained in:
@@ -613,10 +613,14 @@ def Gather(rss, url, cache, options):
|
||||
lim_time = LIM_TIME
|
||||
max_item = MAX_ITEM
|
||||
max_time = MAX_TIME
|
||||
threads = THREADS
|
||||
|
||||
if options.cache:
|
||||
max_time = 0
|
||||
|
||||
if options.mono:
|
||||
threads = 1
|
||||
|
||||
# set
|
||||
def runner(queue):
|
||||
while True:
|
||||
@@ -646,7 +650,7 @@ def Gather(rss, url, cache, options):
|
||||
|
||||
queue = Queue.Queue()
|
||||
|
||||
for i in xrange(THREADS):
|
||||
for i in xrange(threads):
|
||||
t = threading.Thread(target=runner, args=(queue,))
|
||||
t.daemon = True
|
||||
t.start()
|
||||
|
Reference in New Issue
Block a user