diff --git a/providers/sigrefdata/sig_ref_data_provider.py b/providers/sigrefdata/sig_ref_data_provider.py index bf128a9..a718bf5 100644 --- a/providers/sigrefdata/sig_ref_data_provider.py +++ b/providers/sigrefdata/sig_ref_data_provider.py @@ -36,8 +36,10 @@ class SIGRefDataProvider: 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.sigrefs.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.sigrefs.transact(retry=True): for d in new_data: DATA_STORE.sigrefs.set(f"{self.sig_name}:{d.id}", d) diff --git a/templates/add_spot.html b/templates/add_spot.html index f17337d..0a182db 100644 --- a/templates/add_spot.html +++ b/templates/add_spot.html @@ -77,7 +77,7 @@ - + diff --git a/templates/alerts.html b/templates/alerts.html index 3991040..b6dc4d8 100644 --- a/templates/alerts.html +++ b/templates/alerts.html @@ -83,7 +83,7 @@ - + diff --git a/templates/bands.html b/templates/bands.html index 5a68601..cf1ab35 100644 --- a/templates/bands.html +++ b/templates/bands.html @@ -76,8 +76,8 @@ - - + + diff --git a/templates/base.html b/templates/base.html index 184e8e6..61b7f49 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,6 +1,6 @@ {% extends "skeleton.html" %} {% block head_extra %} - + @@ -16,10 +16,10 @@ window.fetchEventSource = fetchEventSource; - - - - + + + + {% end %} {% block body %}