Merge branch 'main' into 147-sig-activity-changes

# Conflicts:
#	providers/activityrefdata/activity_ref_data_provider.py
This commit is contained in:
Ian Renton
2026-09-18 18:58:22 +01:00
9 changed files with 19 additions and 17 deletions
@@ -38,8 +38,10 @@ class ActivityRefDataProvider:
def _add_data(self, new_data):
"""Add all the provided reference data objects to the data store."""
# with transact() batches all writes together to save making thousands of individual sqlite writes
with DATA_STORE.activity_refs.transact():
# with transact() batches all writes together to save making thousands of individual sqlite writes. However,
# that means that each provider holds the lock while it writes, and the default behaviour for other attempted
# transact()s is to fail if they can't get the lock (?!). This behaviour is fixed by retry=True.
with DATA_STORE.activity_refs.transact(retry=True):
for d in new_data:
DATA_STORE.activity_refs.set(f"{self.sig_name}:{d.id}", d)