storyline.py: bug fix

This commit is contained in:
lededev
2021-10-19 00:17:45 +08:00
parent d80b2eeb7d
commit 5da134986a

View File

@@ -31,6 +31,8 @@ def getStoryline(number, title):
apply_sites = [ s for s in storyine_sites if s in G_registered_storyline_site]
mp_args = ((site, number, title, debug) for site in apply_sites)
cores = min(len(apply_sites), os.cpu_count())
if cores == 0:
return ''
run_mode = conf.storyline_mode()
assert run_mode in (0,1,2)
with ThreadPool(cores) if run_mode == 1 else Pool(cores) if run_mode == 2 else noThread() as pool: