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

fix: reduce computer title retry delay #256

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-22.04", "ubuntu-20.04"]
os: ["ubuntu-22.04", "ubuntu-20.04", "ubuntu-24.04"]
steps:
- uses: actions/checkout@v4
with:
Expand Down
8 changes: 5 additions & 3 deletions landscape/client/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def juju_filename(self):
backwards-compatibility."""
return os.path.join(self.data_path, "juju-info.json")

def auto_configure(self, retry=False, delay=120, max_retries=5):
def auto_configure(self, retry=False, delay=15, max_retries=7):
"""Automatically configure the client snap."""
client_conf = snap_http.get_conf("landscape-client").result
auto_enroll_conf = client_conf.get("auto-register", {})
Expand All @@ -224,8 +224,10 @@ def auto_configure(self, retry=False, delay=120, max_retries=5):
if not retry:
break

# retry until we get the computer title (exponential backoff)
# number of retries capped by `max_retries`
# Retry until we get the computer title (with exponential backoff)
# The number of retries is capped by `max_retries`
# With the defaults (delay=15s, max_retries=7), we'll
# retry over a period of ~30 minutes.
time.sleep(delay)
delay *= 2

Expand Down
Loading