Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checks connection every 5 seconds #32

Merged
merged 2 commits into from
Nov 21, 2022
Merged

Conversation

bwhaley
Copy link
Member

@bwhaley bwhaley commented Nov 11, 2022

Updates the connectivity test to check every 5 seconds for about a minute before exiting. This reduces the maximum time a connection loss could occur (previously it could be as long as about a minute).

@bwhaley bwhaley requested review from a team as code owners November 11, 2022 05:10
Returns False if the connection fails and the route is replaced.

"""
try:
Copy link

@sorin-chime sorin-chime Nov 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DRY: looks like an opportunity to have a configurable array of hosts to check and just iterating over that

DEFAULT_CONNECTIVITY_HOSTS = ['https://www.example.com', 'https://www.google.com']

for host in DEFAULT_CONNECTIVITY_HOSTS:
  <check code here>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in 54932c0

@bwhaley bwhaley merged commit 6948a65 into main Nov 21, 2022
@bwhaley bwhaley deleted the adjustable-check-interval branch November 21, 2022 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants