Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

db.get_repoid should use a transaction #72

Open
spbnick opened this issue Jun 5, 2018 · 1 comment
Open

db.get_repoid should use a transaction #72

spbnick opened this issue Jun 5, 2018 · 1 comment

Comments

@spbnick
Copy link
Contributor

spbnick commented Jun 5, 2018

To avoid race condition between checking if a repo ID exists and creating one, db.get_repoid should operate within a transaction. That, or just revert back to using "INSERT OR IGNORE" (which is atomic) since nothing at the moment uses the separate db.create_repoid function.

@spbnick
Copy link
Contributor Author

spbnick commented Jun 5, 2018

A better alternative would be removing ID creation from get_repoid altogether, leaving only ID retrieval.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant