File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -19,14 +19,17 @@ UPDATE_FREQUENCY = 200 # Higher values: Check for updates less often
19
19
20
20
# Get the current and desired client versions
21
21
CURRENT_CLIENT_VERSION = pkg_resources .get_distribution ("os2borgerpc_client" ).version
22
- DESIRED_CLIENT_VERSION = get_config ( "os2borgerpc_client_version" )
22
+ DESIRED_CLIENT_VERSION = None # Default to None
23
23
24
- # Automatically fetch the newest version if configured
25
- if DESIRED_CLIENT_VERSION .lower () == "auto" and random .randint (1 , UPDATE_FREQUENCY ) == 1 :
26
- DESIRED_CLIENT_VERSION = get_newest_client_version ()
24
+ try :
25
+ DESIRED_CLIENT_VERSION = get_config ("os2borgerpc_client_version" )
26
+ except KeyError :
27
+ # If not set, enable periodic: Automatically fetch the newest version if the key is missing
28
+ if random .randint (1 , UPDATE_FREQUENCY ) == 1 :
29
+ DESIRED_CLIENT_VERSION = get_newest_client_version ()
27
30
28
31
# Check for updates if a desired version is specified
29
- if DESIRED_CLIENT_VERSION and DESIRED_CLIENT_VERSION . lower () != "auto" :
32
+ if DESIRED_CLIENT_VERSION :
30
33
stripped_version = DESIRED_CLIENT_VERSION .lstrip ("v" )
31
34
if semver .compare (stripped_version , CURRENT_CLIENT_VERSION ) == 1 :
32
35
print (f"Installed client version: { CURRENT_CLIENT_VERSION } " )
You can’t perform that action at this time.
0 commit comments