Skip to content

Commit

Permalink
fix: reduce computer title retry delay (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
st3v3nmw authored Jul 31, 2024
1 parent bea9394 commit cfd72bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
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

0 comments on commit cfd72bf

Please sign in to comment.