Skip to content

Commit

Permalink
Make checking for version upgrades more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
epwalsh committed Dec 11, 2024
1 parent 3a688c4 commit 58ac870
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ use patch releases for compatibility fixes instead.

## Unreleased

### Fixed

- Made checking for version upgrades more robust.

## [v1.32.2](https://github.com/allenai/beaker-py/releases/tag/v1.32.2) - 2024-11-13

### Fixed
Expand Down
16 changes: 8 additions & 8 deletions beaker/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,20 +140,20 @@ def _check_for_upgrades(self):
if _LATEST_VERSION_CHECKED:
return

config = InternalConfig.load()
if (
config is not None
and config.version_checked is not None
and (time.time() - config.version_checked <= self.VERSION_CHECK_INTERVAL)
):
return

import warnings

import packaging.version
import requests

try:
config = InternalConfig.load()
if (
config is not None
and config.version_checked is not None
and (time.time() - config.version_checked <= self.VERSION_CHECK_INTERVAL)
):
return

response = requests.get(
"https://api.github.com/repos/allenai/beaker-py/releases/latest", timeout=1
)
Expand Down

0 comments on commit 58ac870

Please sign in to comment.