parent
5dd262139d
commit
f46576168a
|
@ -49,6 +49,7 @@ The arguments are:
|
||||||
- `hungry`: grab full-article even if it already looks long enough
|
- `hungry`: grab full-article even if it already looks long enough
|
||||||
- `cache`: only take articles from the cache (ie. don't grab new articles' content), so as to save time
|
- `cache`: only take articles from the cache (ie. don't grab new articles' content), so as to save time
|
||||||
- `debug`: to have some feedback from the script execution. Useful for debugging
|
- `debug`: to have some feedback from the script execution. Useful for debugging
|
||||||
|
- `mono`: disable multithreading while fetching, makes debugging easier
|
||||||
- `theforce`: force download the rss feed
|
- `theforce`: force download the rss feed
|
||||||
- `silent`: don't output the final RSS (useless on its own, but can be nice when debugging)
|
- `silent`: don't output the final RSS (useless on its own, but can be nice when debugging)
|
||||||
- `smart`: try to show only new elements in feed, to make it lighter (based on 304 headers)
|
- `smart`: try to show only new elements in feed, to make it lighter (based on 304 headers)
|
||||||
|
|
|
@ -613,10 +613,14 @@ def Gather(rss, url, cache, options):
|
||||||
lim_time = LIM_TIME
|
lim_time = LIM_TIME
|
||||||
max_item = MAX_ITEM
|
max_item = MAX_ITEM
|
||||||
max_time = MAX_TIME
|
max_time = MAX_TIME
|
||||||
|
threads = THREADS
|
||||||
|
|
||||||
if options.cache:
|
if options.cache:
|
||||||
max_time = 0
|
max_time = 0
|
||||||
|
|
||||||
|
if options.mono:
|
||||||
|
threads = 1
|
||||||
|
|
||||||
# set
|
# set
|
||||||
def runner(queue):
|
def runner(queue):
|
||||||
while True:
|
while True:
|
||||||
|
@ -646,7 +650,7 @@ def Gather(rss, url, cache, options):
|
||||||
|
|
||||||
queue = Queue.Queue()
|
queue = Queue.Queue()
|
||||||
|
|
||||||
for i in xrange(THREADS):
|
for i in xrange(threads):
|
||||||
t = threading.Thread(target=runner, args=(queue,))
|
t = threading.Thread(target=runner, args=(queue,))
|
||||||
t.daemon = True
|
t.daemon = True
|
||||||
t.start()
|
t.start()
|
||||||
|
|
Loading…
Reference in New Issue