Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Build: Update GeoIP/GeoSite Cache per hour #4247

Merged
merged 7 commits into from
Jan 5, 2025

Conversation

KobeArthurScofield
Copy link
Contributor

@KobeArthurScofield KobeArthurScofield commented Jan 4, 2025

根据 #4235 (comment) 提到的方法,将 prepare 里面更新 GeoData 单独抽出来用 schedule 触发器定时更新,每小时检查更新。

对于 GeoIP/GeoSite 来说,大部分时间构建用的是更新保存的缓存,只有上游有更新才需要更新这个缓存。而每次构建都访问上游在 actions 比较多的时候会显得有些麻烦(两三个的时候还好, actions 多了会导致排队,有机会出现构建压缩包附带文件不一致的问题),因此将这些资源用定时统一更新的方法缓存后,在构建时用于使用而免去访问上游的步骤。

目前设定上最多使附带的 GeoData 文件晚于上游 1 小时,一般情况下已经足够使用。

@KobeArthurScofield
Copy link
Contributor Author

每四小时或者每三小时更新也可以

@RPRX
Copy link
Member

RPRX commented Jan 4, 2025

改成 hourly-prepare 吧,release 不需要额外触发

还有 paths-ignore 需要全删掉,没有必要去想哪些需要排除,新 commit 一律触发,我都写得很明确了你咋又把限制加上了

不过这个 hourly-prepare 不会在每个分支都生效一份吧,可以设置整个项目只生效一份吗

@KobeArthurScofield
Copy link
Contributor Author

改成 hourly-prepare 吧,release 不需要额外触发

这个可以

我都写得很明确了你咋又把限制加上了

调整 issue template 或者调整 dependabot 之类的又弄得全部出动好像必要性不是很大,而且动了 docker 触发普通 build 或者加个 friendly-name 触发 docker 好像又有点多余……
要不统一成修改 issue template 及 dependabot 别出动就行。

不过这个 hourly-prepare 不会在每个分支都生效一份吧,可以设置整个项目只生效一份吗

只会触发主分支的

@RPRX
Copy link
Member

RPRX commented Jan 4, 2025

就是无差别每个 commit 触发一次,没有什么多余的,那些文件又不常改,多触发一次又没什么,省得费脑细胞

@KobeArthurScofield KobeArthurScofield changed the title Build: Update GeoIP/GeoSite Cache per 12 hours Build: Update GeoIP/GeoSite Cache per hour Jan 4, 2025
@RPRX
Copy link
Member

RPRX commented Jan 4, 2025

只会触发主分支的

这个你再确认一下

@KobeArthurScofield
Copy link
Contributor Author

只会触发主分支的

这个你再确认一下

https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#schedule

  • This event will only trigger a workflow run if the workflow file is on the default branch.
  • Scheduled workflows will only run on the default branch.

@RPRX RPRX merged commit aeb12d9 into XTLS:main Jan 5, 2025
36 checks passed
LuciusMortified added a commit to LuciusMortified/Xray-core that referenced this pull request Jan 5, 2025
Build: Update GeoIP/GeoSite Cache per hour (XTLS#4247)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants