etalab / rncs_worker_api_entreprise

API pour récupérer et mettre à disposition les données du Répertoire National du Commerce et des Société
https://entreprise.data.gouv.fr
MIT License
23 stars 13 forks source link

Status of a running daily update can't be read from database #61

Open brindu opened 5 years ago

brindu commented 5 years ago

DailyUpdate's status is compute from it's units status. When asking for the status of a daily update while importing it (typically DailyUpdateTribunalCommerce.current.status ActiveRecord returns nil.

This may be caused by units being imported in concurrent transactions. Tables may somehow be locked.

brindu commented 5 years ago

If the issue is related to a database transaction lock it might be a solution to set the 'LOADING' status for the unit import before entering the transaction.