Various Fixes.
generified the Worldboss module; removed the spammy-section as of currently, will be readded at a later stage.
This commit is contained in:
@@ -35,6 +35,7 @@ class OrgPorkService:
|
||||
cache_result = self.cache_service.retrieve(self.CACHE_GROUP, cache_key)
|
||||
|
||||
is_cache = False
|
||||
result = None
|
||||
if cache_result and cache_result.last_modified > (t - self.CACHE_MAX_AGE):
|
||||
result = json.loads(cache_result.data)
|
||||
is_cache = True
|
||||
@@ -43,8 +44,13 @@ class OrgPorkService:
|
||||
|
||||
try:
|
||||
r = requests.get(url, timeout=5)
|
||||
result = r.json()
|
||||
|
||||
d = r.json()
|
||||
if len(d[1]) > 0:
|
||||
result = d
|
||||
elif cache_result:
|
||||
result = json.loads(cache_result.data)
|
||||
if not result:
|
||||
return None
|
||||
# if data is invalid
|
||||
if result[0]["ORG_INSTANCE"] != org_id:
|
||||
result = None
|
||||
|
||||
Reference in New Issue
Block a user