fix caching tasks

This commit is contained in:
sadnub 2022-04-09 22:00:56 -04:00
parent c2286cde01
commit 6b4704b2e2
1 changed files with 1 additions and 4 deletions

View File

@ -693,12 +693,9 @@ class Agent(BaseAuditModel):
cache_tasks = False
if not self.policy and not self.block_policy_inheritance:
print("Cachin and Stashin")
cached_tasks = cache.get(f"site_{self.site_id}_tasks")
print(cached_tasks)
if cached_tasks and isinstance(cached_tasks, list):
print("Returning")
return cached_tasks
return cache_tasks
else:
cached_tasks = True
# get agent tasks based on policies