hirmeos / altmetrics

Implementation of HIRMEOS WP6
MIT License
5 stars 0 forks source link

lock database for Uri being updated by different plugins #41

Closed rowan08 closed 5 years ago

rowan08 commented 5 years ago

Prevent different plugins trying to create the same entry, causing DB conflicts, by locking the row in the DB for that entry until the plugin has finished processing it.

Trello card: https://trello.com/c/TvICorNn/2989-3-hirmeos-wp6

rowan08 commented 5 years ago

@fradeve, the way to unlock the row in the database is to call db.commit(), which happens after the task finishes running. Alternatively, if the task that has set the lock crashes for any reason, it will also unlock the row in the database.

In theory, max_retries only needs to match the number pluggins running for each task, but there shouldn't be any problem with setting it higher :+1: