| |
@@ -70,12 +70,16 @@
|
| |
|
| |
def get_refreshed_time(self, item, *args, **kwargs):
|
| |
what = self._construct_what(item, *args, **kwargs)
|
| |
- from_db = CachedData.query.filter_by(provider=what).first()
|
| |
|
| |
- if not from_db:
|
| |
- return None
|
| |
+ local = self._local_cache.get(what)
|
| |
+ if self._new_enough(local):
|
| |
+ return local.time_created
|
| |
+
|
| |
+ from_db = CachedData.query.filter_by(provider=what).first()
|
| |
+ if self._new_enough(from_db):
|
| |
+ return from_db.time_created
|
| |
|
| |
- return from_db.time_created
|
| |
+ return None
|
| |
|
| |
def __get(self, synchronous, priority, item, *args, **kwargs):
|
| |
if item not in self._refreshers:
|
| |