Skip to content

Commit

Permalink
catch concurrent writes and continue w/o raising
Browse files Browse the repository at this point in the history
  • Loading branch information
drewbanin committed Apr 25, 2017
1 parent fe4647f commit c5dfc55
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dbt/compilation.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,12 @@ def __write(self, build_filepath, payload):
target_path = os.path.join(self.project['target-path'], build_filepath)

if not os.path.exists(os.path.dirname(target_path)):
os.makedirs(os.path.dirname(target_path))
# concurrent writes that try to create the same dir can fail
try:
os.makedirs(os.path.dirname(target_path))
except FileExistsError:
logger.debug("Caught concurrent write: {}".format(target_path))
pass

dbt.compat.write_file(target_path, payload)

Expand Down

0 comments on commit c5dfc55

Please sign in to comment.