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:
2022-06-24 18:10:45 +02:00
parent e942ac43fa
commit 84a5933490
20 changed files with 274 additions and 176 deletions
+8 -2
View File
@@ -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