-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
fix: not clearing the template engine cache after upgrading the theme #2970
Conversation
src/main/java/run/halo/app/core/extension/theme/ThemeEndpoint.java
Outdated
Show resolved
Hide resolved
感谢 @minliacom 的贡献,在 Review 前请先签署我们的 CLA 协议:#2970 (comment) 另外,测试似乎没有通过。 |
src/main/java/run/halo/app/core/extension/theme/ThemeEndpoint.java
Outdated
Show resolved
Hide resolved
我忽略了一点 卸载的时候应该要在 reconciler 清除缓存,需要在 ThemeResolver 中添加一个根据 theme name 得到 ThemeContext 的方法 |
嗯,我按这样尝试一下 |
如果要更细致的话,在切换主题的时候也得清理 Thymeleaf 缓存。 |
Hi @minliacom ,建议当前 PR 只解决升级时清理缓存即可。暂时不用管删除和切换主题的情况。 |
那我先把删除和切换的代码删除了再提交 |
src/main/java/run/halo/app/core/extension/reconciler/ThemeReconciler.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
经测试符合预期 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/hold Please wait for my code review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/unhold
这里有一个名为
|
864ef5b
to
a0496f0
Compare
a0496f0
to
2fce599
Compare
2fce599
to
070ac36
Compare
@ruibaby OK了 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: guqing, JohnNiang The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@halo-dev/sig-halo 其他需要清理缓存的情况是否需要提交 issue 呢? |
What type of PR is this?
/kind improvement
What this PR does / why we need it:
通过在模板引擎管理器里添加clearCache方法,在升级主题后进行缓存刷新,让新模板内容生效。
Which issue(s) this PR fixes:
Fixes #2953
Special notes for your reviewer:
Does this PR introduce a user-facing change?