Commit 49e3a5dd authored by Loic Esteve's avatar Loic Esteve Committed by Hardik Juneja

Better implementation of effective_n_jobs

to prevent n_jobs <=0
parent 4047fcc7
......@@ -79,8 +79,13 @@ if ENABLE_JOBLIB:
def __init__(self, *args, **kwargs):
self.zope_context = kwargs['zope_context']
def effective_n_jobs(self, n_jobs):
# TODO
return n_jobs
"""Dummy implementation to prevent n_jobs <=0
and allow (sequential) n_jobs=1 and n_jobs != 1 (parallel) behaviour
"""
if n_jobs == 0:
raise ValueError('n_jobs == 0 in Parallel has no meaning')
return abs(n_jobs)
def apply_async(self, batch, callback=None):
"""Schedule a func to be run"""
portal_activities = self.zope_context.portal_activities
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment