Skip to content

Commit

Permalink
Merge pull request ckan#6638 from qld-gov-au/site-user-creation-race
Browse files Browse the repository at this point in the history
[QOL-8368] fix race condition in creating the default site user
  • Loading branch information
amercader authored Feb 4, 2022
2 parents df0079e + 12d7edb commit 8723840
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ckan/config/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,9 @@ def update_config():
except (sqlalchemy.exc.ProgrammingError, sqlalchemy.exc.OperationalError):
# The database is not yet initialised. It happens in `ckan db init`
pass
except sqlalchemy.exc.IntegrityError:
# Race condition, user already exists.
pass

# Close current session and open database connections to ensure a clean
# clean environment even if an error occurs later on
Expand Down

0 comments on commit 8723840

Please sign in to comment.