[wmlunits] Don't start more than one convert process at a time...

Starting many at once will stall CPUs and IO, and if delayed (so there
are 100ds or 1000ds of processes running at the same time) possibly
require massive amounts of memory.
This commit is contained in:
Elias Pschernig 2009-09-15 16:33:42 +00:00
parent 46f6fcd7dd
commit ec651a6acc
2 changed files with 4 additions and 2 deletions

View file

@ -92,6 +92,7 @@ if __name__ == '__main__':
if verbose:
print convertor + " '" + infilename + "' '" + outfilename + "'"
if not dryrun:
Popen(convertor.split() + [infilename, outfilename])
p = Popen(convertor.split() + [infilename, outfilename])
p.wait()
# TeamColorizer ends here.

View file

@ -135,7 +135,8 @@ class ImageCollector:
# helpers.py currently executing.
command = os.path.join(os.path.dirname(__file__),
"TeamColorizer")
Popen([command, ipath, opath])
p = Popen([command, ipath, opath])
p.wait()
else:
sys.stderr.write(
"Warning: Required image %s: \"%s\" does not exist.\n" % (c, i))