Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Bug] 重启后 geo-update-interval 更新时间间隔会重新计算 #1261

Closed
5 of 7 tasks
xiaoQQya opened this issue May 13, 2024 · 8 comments
Closed
5 of 7 tasks
Labels
bug Something isn't working

Comments

@xiaoQQya
Copy link

Verify steps

  • 我已经阅读了 文档,了解所有我编写的配置文件项的含义,而不是大量堆砌看似有用的选项或默认值。
  • 我未仔细看过 文档 并解决问题
  • 我未在 Issue Tracker 中寻找过我要提出的问题
  • 我已经使用最新的 Alpha 分支版本测试过,问题依旧存在
  • 我提供了可以在本地重现该问题的服务器、客户端配置文件与流程,而不是一个脱敏的复杂客户端配置文件。
  • 我提供了可用于重现我报告的错误的最简配置,而不是依赖远程服务器、TUN、图形界面客户端或者其他闭源软件。
  • 我提供了完整的配置文件与日志,而不是出于对自身智力的自信而仅提供了部分认为有用的部分。

操作系统

Windows

系统版本

Windows 11 专业版 22631.3527

Mihomo 版本

Mihomo Meta alpha-6d1c62b windows amd64 with go1.22.2 Wed May 8 01:30:29 UTC 2024
Use tags: with_gvisor

配置文件

geodata-mode: true
geodata-loader: memconservative
geo-auto-update: true
geo-update-interval: 24
geox-url:
  geoip: https://mirror.ghproxy.com/https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.dat
  geosite: https://mirror.ghproxy.com/https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat
  mmdb: https://mirror.ghproxy.com/https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.metadb

描述

启用 geo-auto-update,设置 geo-update-interval 为 24h,在 mihomo 内核不关闭的情况下,每 24h 会自动更新 geodata;如果在中途 mihomo 重启过,geodata 更新的时间间隔似乎会重新计算。

考虑日常使用场景,设置 geo-update-interval 为 24h,每天早上启动 mihomo,晚上关机关闭 mihomo ,因时间不足 24h 所以不会触发 geodata 自动更新,每天如此会导致 geodata 一直不会更新,只能手动更新。

期望同 provider 一样,在启动时检查上次更新时间,如果超过了设置的更新间隔,则进行更新。

重现方式

  1. 配置文件中启用 geo-auto-update 并设置 geo-update-interval 为 1h;
  2. 启动 mihomo 后在 1h 内退出;
  3. 等待 1h 之后再次启动 mihomo,此时距 geodata 文件的修改时间已经超过了 1h,但并不会自动更新 geodata 数据;

日志

@xiaoQQya xiaoQQya added the bug Something isn't working label May 13, 2024
@xiaoQQya xiaoQQya changed the title [Bug] 重启后 geo-update-interval 配置没有生效 [Bug] 重启后 geo-update-interval 更新时间间隔会重新计算 May 13, 2024
@xishang0128
Copy link
Contributor

@xiaoQQya 这是预期行为,应用重启计时器也跟着重启

@xiaoQQya
Copy link
Author

@xiaoQQya 这是预期行为,应用重启计时器也跟着重启

嗯嗯,我明白这是预期行为,可否在启动时检查 geodata 文件上次更新时间,如果超过了设置的更新间隔,则立即进行更新。

@Larvan2
Copy link
Collaborator

Larvan2 commented May 13, 2024

@xiaoQQya 有空加

@xiaoQQya
Copy link
Author

@xiaoQQya 有空加

好的,辛苦

@PctAIGM
Copy link

PctAIGM commented May 13, 2024

是不是可以引入cron表达式支持定时更新?这样更灵活,可以指定每天几点更新

Larvan2 added a commit that referenced this issue May 17, 2024
@lux5am
Copy link

lux5am commented May 18, 2024

@xiaoQQya is there any clash api for manual update? Maybe I can use cron with curl.

@xiaoQQya
Copy link
Author

@xiaoQQya is there any clash api for manual update? Maybe I can use cron with curl.

@lux5am https://wiki.metacubex.one/api/#configsgeo

@lux5am
Copy link

lux5am commented May 19, 2024

Wa

@xiaoQQya is there any clash api for manual update? Maybe I can use cron with curl.

@lux5am https://wiki.metacubex.one/api/#configsgeo

Thanks sir

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants