ckan / datapusher

A standalone web service that pushes data files from a CKAN site resources into its DataStore
GNU Affero General Public License v3.0
77 stars 154 forks source link

duplicate key value violates unique constraint on first start with wsgi workers/threads #249

Open categulario opened 2 years ago

categulario commented 2 years ago

If the database is not set and the first start of datapusher is done via wsgi with some workers/threads (as suggested by 'High availability setup') then just the first thread that tries to create the database succeeds and the rest fail with duplicate key value violates unique constraint.

If the number of threads and workers is reduced to 1 on first start then nothing breaks.

A possible fix for this would be to provide a command for database initialization like in CKAN