Merge pull request #211 from snh/another-pop

Iterate over a copy of the dictionary (2nd instalment)
pull/212/head
Mark Jessop 2019-09-09 22:54:51 +09:30 zatwierdzone przez GitHub
commit ea8117880e
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -325,7 +325,7 @@ def handle_scan_results():
def clean_task_list():
""" Check the task list to see if any tasks have stopped running. If so, release the associated SDR """
for _key in autorx.task_list.keys():
for _key in autorx.task_list.copy().keys():
# Attempt to get the state of the task
try:
_running = autorx.task_list[_key]['task'].running()
@ -358,7 +358,7 @@ def clean_task_list():
flask_emit_event('task_event')
# Clean out the temporary block list of old entries.
for _freq in temporary_block_list.keys():
for _freq in temporary_block_list.copy().keys():
if temporary_block_list[_freq] < (time.time() - config['temporary_block_time']*60):
temporary_block_list.pop(_freq)
logging.info("Task Manager - Removed %.3f MHz from temporary block list." % (_freq/1e6))

Wyświetl plik

@ -657,7 +657,7 @@ class SondeScanner(object):
# Remove any frequencies in the temporary block list
self.temporary_block_list_lock.acquire()
for _frequency in self.temporary_block_list.keys():
for _frequency in self.temporary_block_list.copy().keys():
# Check the time the block was added.
if self.temporary_block_list[_frequency] > (time.time()-self.temporary_block_time*60):
# We should still be blocking this frequency, so remove any peaks with this frequency.