Skip to content

Commit

Permalink
make path_base_sessions dir now in try/except to allow multiple workers
Browse files Browse the repository at this point in the history
  • Loading branch information
sharif1093 committed Aug 16, 2019
1 parent 4cacef7 commit eba1951
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion digideep/pipeline/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,18 @@ def __init__(self, root_path):


# 1. Creating 'path_base_sessions', i.e. '/tmp/digideep_sessions':
if not os.path.exists(self.state['path_base_sessions']): # TODO: and not self.dry_run:
try: # TODO: and not self.dry_run:
os.makedirs(self.state['path_base_sessions'])
# Create an empty __init__.py in it!
with open(os.path.join(self.state['path_base_sessions'], '__init__.py'), 'w') as f:
print("", file=f)
except Exception as ex:
print(ex)
# if not os.path.exists(self.state['path_base_sessions']): # TODO: and not self.dry_run:
# os.makedirs(self.state['path_base_sessions'])
# # Create an empty __init__.py in it!
# with open(os.path.join(self.state['path_base_sessions'], '__init__.py'), 'w') as f:
# print("", file=f)

# 2. Create a unique 'path_session':
if not self.dry_run:
Expand Down

0 comments on commit eba1951

Please sign in to comment.