diff --git a/cauldron/db.py b/cauldron/db.py index c860082..3561283 100644 --- a/cauldron/db.py +++ b/cauldron/db.py @@ -100,8 +100,10 @@ class DB: if ver in done: continue cur.execute(sql) + # IGNORE to tolerate the multi-worker boot race where two + # gunicorn workers both bootstrap an empty migrations table cur.execute( - "INSERT INTO schema_migrations (version) VALUES (%s)", (ver,) + "INSERT IGNORE INTO schema_migrations (version) VALUES (%s)", (ver,) ) applied.append(ver) return applied