Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sqlite): Gracefully handle issues creating sqlite indices
The creation of the `spr_obsolete` index is problematic for the PIP service and any of the admin lookup workers running in the importers. Because there are always multiple processes doing admin lookup, and each one tries to create the index if it doesn't exist, most end up failing. SQLite only allows a single write lock on the DB, so all but one will fail to achieve it. However, in my testing, all it takes to solve this gracefully is to wrap the index creation in a try/catch block. The index will be created by one of the worker processes, and all subsequent queries appear to have the performance improvements of the index (about 30-50% faster time to load admin data). Supersedes #431 Fixes #454 Connects #453 (we should not actually remove the index creation quite yet)
- Loading branch information