Skip to content

Commit

Permalink
Merge pull request #8944 from olliewalsh/issue_8941
Browse files Browse the repository at this point in the history
Fix issue #8941
  • Loading branch information
thatch45 committed Dec 2, 2013
2 parents cd25ae6 + 8287633 commit 0d7c08e
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions salt/utils/schedule.py
Expand Up @@ -243,15 +243,17 @@ def eval(self):
'job {0}, defaulting to 1.'.format(job))
data['maxrunning'] = 1

if self.opts.get('multiprocessing', True):
thread_cls = multiprocessing.Process
else:
thread_cls = threading.Thread
proc = thread_cls(target=self.handle_func, args=(func, data))
proc.start()
if self.opts.get('multiprocessing', True):
proc.join()
self.intervals[job] = int(time.time())
try:
if self.opts.get('multiprocessing', True):
thread_cls = multiprocessing.Process
else:
thread_cls = threading.Thread
proc = thread_cls(target=self.handle_func, args=(func, data))
proc.start()
if self.opts.get('multiprocessing', True):
proc.join()
finally:
self.intervals[job] = int(time.time())


def clean_proc_dir(opts):
Expand Down

0 comments on commit 0d7c08e

Please sign in to comment.