Commit cacea29b by Sebastien Robin

genbt5list: prevent conflicts when several process calls genbt5list in parallel

1 parent 819d824b
......@@ -215,7 +215,8 @@ def main(dir_list=None, **kw):
for d in dir_list:
bt5list = generateInformation(d, **kw).getvalue()
d = os.path.join(d, 'bt5list.new')
# add pid in filename to avoid conflicts if several process calls genbt5list
d = os.path.join(d, 'bt5list.new.%i' % os.getpid())
try:
with open(d, 'wb') as f:
f.write(bt5list)
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!