Skip to content
This repository has been archived by the owner on Feb 22, 2025. It is now read-only.

Commit

Permalink
Merge pull request #804 from 9Mad-Max5/dir_con
Browse files Browse the repository at this point in the history
fix the for loop for direct connection check
  • Loading branch information
rix1337 authored Sep 29, 2024
2 parents 9c763db + b9367c4 commit 788c16f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion feedcrawler/external_tools/myjd_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ def action(self, path, params=(), http_action="POST"):
return response['data']
else:
# Direct connection info available, we try to use it.
for conn in self.__direct_connection_info:
for conn in self.__direct_connection_info[:]:
connection_ip = conn['conn']['ip']
# prevent connection to internal docker ip
if time.time() > conn['cooldown']:
Expand All @@ -863,6 +863,7 @@ def action(self, path, params=(), http_action="POST"):
conn['cooldown'] = time.time() + 3600
self.__direct_connection_info.remove(conn)
self.__direct_connection_info.append(conn)

# None of the direct connections worked, we set a cooldown for direct connections
self.__direct_connection_consecutive_failures += 1
self.__direct_connection_cooldown = time.time() + (60 * self.__direct_connection_consecutive_failures)
Expand Down

0 comments on commit 788c16f

Please sign in to comment.