Qualys: actkeys cache 24h + refresh timeout 600s
This commit is contained in:
parent
07775a385f
commit
1bfdb16bfb
@ -499,7 +499,7 @@ def get_activation_keys(db):
|
|||||||
"type": (parse_xml(block, "type") or [""])[0],
|
"type": (parse_xml(block, "type") or [""])[0],
|
||||||
})
|
})
|
||||||
|
|
||||||
_cache.set(cache_key, keys, 3600) # 1h pour les keys
|
_cache.set(cache_key, keys, 86400) # 1h pour les keys
|
||||||
return keys
|
return keys
|
||||||
|
|
||||||
|
|
||||||
@ -588,7 +588,7 @@ def _refresh_all_agents_impl(db):
|
|||||||
r = requests.post(
|
r = requests.post(
|
||||||
f"{qualys_url}/qps/rest/2.0/search/am/hostasset",
|
f"{qualys_url}/qps/rest/2.0/search/am/hostasset",
|
||||||
json=payload, auth=(qualys_user, qualys_pass),
|
json=payload, auth=(qualys_user, qualys_pass),
|
||||||
verify=False, timeout=300, proxies=proxies,
|
verify=False, timeout=600, proxies=proxies,
|
||||||
headers={"X-Requested-With": "PatchCenter", "Content-Type": "application/json"})
|
headers={"X-Requested-With": "PatchCenter", "Content-Type": "application/json"})
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return {"ok": False, "msg": f"page {stats['pages']}: {e}", **stats}
|
return {"ok": False, "msg": f"page {stats['pages']}: {e}", **stats}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user