fix Cloudflare IP优选 v1.4 修复立即运行一次

This commit is contained in:
thsrite
2024-06-17 21:19:15 +08:00
parent 132a125f7a
commit e27fbff941
2 changed files with 5 additions and 4 deletions

View File

@@ -172,11 +172,12 @@
"name": "Cloudflare IP优选", "name": "Cloudflare IP优选",
"description": "🌩 测试 Cloudflare CDN 延迟和速度自动优选IP。", "description": "🌩 测试 Cloudflare CDN 延迟和速度自动优选IP。",
"labels": "网络,站点", "labels": "网络,站点",
"version": "1.3", "version": "1.4",
"icon": "cloudflare.jpg", "icon": "cloudflare.jpg",
"author": "thsrite", "author": "thsrite",
"level": 1, "level": 1,
"history": { "history": {
"v1.4": "修复立即运行一次",
"v1.3": "调整插件开启状态判断条件", "v1.3": "调整插件开启状态判断条件",
"v1.2": "增强API安全性" "v1.2": "增强API安全性"
} }

View File

@@ -32,7 +32,7 @@ class CloudflareSpeedTest(_PluginBase):
# 插件图标 # 插件图标
plugin_icon = "cloudflare.jpg" plugin_icon = "cloudflare.jpg"
# 插件版本 # 插件版本
plugin_version = "1.3" plugin_version = "1.4"
# 插件作者 # 插件作者
plugin_author = "thsrite" plugin_author = "thsrite"
# 作者主页 # 作者主页
@@ -81,7 +81,7 @@ class CloudflareSpeedTest(_PluginBase):
self._notify = config.get("notify") self._notify = config.get("notify")
self._check = config.get("check") self._check = config.get("check")
if self.get_state() and self._onlyonce: if (self._ipv4 or self._ipv6) and self._onlyonce:
try: try:
self._scheduler = BackgroundScheduler(timezone=settings.TZ) self._scheduler = BackgroundScheduler(timezone=settings.TZ)
logger.info(f"Cloudflare CDN优选服务启动立即运行一次") logger.info(f"Cloudflare CDN优选服务启动立即运行一次")
@@ -318,7 +318,7 @@ class CloudflareSpeedTest(_PluginBase):
if not install_flag \ if not install_flag \
and release_version == self._version \ and release_version == self._version \
and not Path( and not Path(
f'{self._cf_path}/{self._binary_name}').exists() \ f'{self._cf_path}/{self._binary_name}').exists() \
and not Path(f'{self._cf_path}/CloudflareST.exe').exists(): and not Path(f'{self._cf_path}/CloudflareST.exe').exists():
logger.warn(f"未检测到CloudflareSpeedTest本地版本重新安装") logger.warn(f"未检测到CloudflareSpeedTest本地版本重新安装")
install_flag = True install_flag = True