Tidy up proxies.json logic, adding tests (#955)

This commit is contained in:
dgtlmoon
2022-09-19 13:14:35 +02:00
committed by GitHub
parent 8567a83c47
commit d4715e2bc8
11 changed files with 207 additions and 39 deletions

View File

@@ -1444,12 +1444,7 @@ def ticker_thread_check_time_launch_checks():
if not uuid in running_uuids and uuid not in [q_uuid for p,q_uuid in update_q.queue]:
# Proxies can be set to have a limit on seconds between which they can be called
watch_proxy = watch.get('proxy')
if not watch_proxy:
watch_proxy = datastore.data['settings']['requests']['proxy']
if not watch_proxy:
watch_proxy = list(datastore.proxy_list.keys())[0]
watch_proxy = datastore.get_preferred_proxy_for_watch(uuid=uuid)
if watch_proxy and watch_proxy in list(datastore.proxy_list.keys()):
# Proxy may also have some threshold minimum
proxy_list_reuse_time_minimum = int(datastore.proxy_list.get(watch_proxy, {}).get('reuse_time_minimum', 0))