Skip to content

Commit

Permalink
Fix issue saltstack#8941
Browse files Browse the repository at this point in the history
  • Loading branch information
olliewalsh committed Dec 2, 2013
1 parent 49e3964 commit 8287633
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 8287633

Please sign in to comment.