mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-06-23 21:25:12 +00:00
Use diskcache to store solar_conditions object
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user