Use diskcache to store solar_conditions object

This commit is contained in:
Ian Renton
2026-05-16 10:37:34 +01:00
parent 3e7d2c2bc2
commit 6058eb5053
11 changed files with 30 additions and 26 deletions

View File

@@ -16,10 +16,11 @@ class SolarConditionsProvider:
self.status = "Not Started" if self.enabled else "Disabled"
self._solar_conditions = None
def setup(self, solar_conditions):
"""Set up the provider, giving it the solar conditions dict to update"""
def setup(self, solar_conditions, solar_conditions_cache):
"""Set up the provider, giving it the solar conditions object and its backing cache"""
self._solar_conditions = solar_conditions
self._solar_conditions_cache = solar_conditions_cache
def start(self):
"""Start the provider. This should return immediately after spawning threads to access the remote resources"""
@@ -39,3 +40,4 @@ class SolarConditionsProvider:
if hasattr(self._solar_conditions, key):
setattr(self._solar_conditions, key, value)
self._solar_conditions.infer_descriptions()
self._solar_conditions_cache['solar_conditions'] = self._solar_conditions