@@ -69,7 +69,7 @@ def fetch_snap_hutao_github_latest_version() -> PatchMeta:
69
69
return github_path_meta
70
70
71
71
72
- async def update_snap_hutao_latest_version (redis_client ) -> dict :
72
+ async def update_snap_hutao_latest_version (redis_client : redis . client . Redis ) -> dict :
73
73
"""
74
74
Update Snap Hutao latest version from GitHub and Jihulab
75
75
:return: dict of latest version metadata
@@ -118,7 +118,7 @@ async def update_snap_hutao_latest_version(redis_client) -> dict:
118
118
119
119
# Clear mirror URL if the version is updated
120
120
try :
121
- redis_cached_version = redis_client .get ("snap-hutao:version" )
121
+ redis_cached_version = await redis_client .get ("snap-hutao:version" )
122
122
if redis_cached_version != github_patch_meta .version :
123
123
# Re-initial the mirror list with empty data
124
124
logger .info (
@@ -146,7 +146,7 @@ async def update_snap_hutao_latest_version(redis_client) -> dict:
146
146
return return_data
147
147
148
148
149
- async def update_snap_hutao_deployment_version (redis_client ) -> dict :
149
+ async def update_snap_hutao_deployment_version (redis_client : redis . client . Redis ) -> dict :
150
150
"""
151
151
Update Snap Hutao Deployment latest version from GitHub and Jihulab
152
152
:return: dict of Snap Hutao Deployment latest version metadata
@@ -179,14 +179,14 @@ async def update_snap_hutao_deployment_version(redis_client) -> dict:
179
179
mirrors = [MirrorMeta (url = cn_urls [0 ], mirror_name = "JiHuLAB" , mirror_type = "direct" )]
180
180
)
181
181
182
- current_cached_version = redis_client .get ("snap-hutao-deployment:version" )
182
+ current_cached_version = await redis_client .get ("snap-hutao-deployment:version" )
183
183
if current_cached_version != jihulab_meta ["tag_name" ]:
184
184
logger .info (
185
185
f"Found unmatched version, clearing mirrors. Setting Snap Hutao Deployment latest version to Redis: { await redis_client .set ('snap-hutao-deployment:version' , jihulab_patch_meta .version )} " )
186
186
logger .info (
187
- f"Reinitializing mirrors for Snap Hutao Deployment: { await redis_client .set (f'snap-hutao-deployment:mirrors:{ await jihulab_patch_meta .version } ' , json .dumps ([]))} " )
187
+ f"Reinitializing mirrors for Snap Hutao Deployment: { await redis_client .set (f'snap-hutao-deployment:mirrors:{ jihulab_patch_meta .version } ' , json .dumps ([]))} " )
188
188
else :
189
- current_mirrors = json .loads (redis_client .get (f"snap-hutao-deployment:mirrors:{ jihulab_patch_meta .version } " ))
189
+ current_mirrors = json .loads (await redis_client .get (f"snap-hutao-deployment:mirrors:{ jihulab_patch_meta .version } " ))
190
190
for m in current_mirrors :
191
191
this_mirror = MirrorMeta (** m )
192
192
jihulab_patch_meta .mirrors .append (this_mirror )
0 commit comments