Fetching - Check the most overdue watch first (#1242)

pull/1246/head
dgtlmoon 2 years ago committed by GitHub
parent 44dc62da2d
commit 235535c327
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1449,7 +1449,11 @@ def ticker_thread_check_time_launch_checks():
watch_uuid_list = [] watch_uuid_list = []
while True: while True:
try: try:
watch_uuid_list = datastore.data['watching'].keys() # Get a list of watches sorted by last_checked, [1] because it gets passed a tuple
# This is so we examine the most over-due first
for k in sorted(datastore.data['watching'].items(), key=lambda item: item[1].get('last_checked',0)):
watch_uuid_list.append(k[0])
except RuntimeError as e: except RuntimeError as e:
# RuntimeError: dictionary changed size during iteration # RuntimeError: dictionary changed size during iteration
time.sleep(0.1) time.sleep(0.1)

Loading…
Cancel
Save