Fix the problem of memory leak caused by thymeleaf (#7678)

#### What type of PR is this?

/kind bug
/area core
/milestone 2.21.x

#### What this PR does / why we need it:

This PR replaces the dependency `thymeleaf-spring6` to apply the memory leak fix of <https://github.com/halo-dev/thymeleaf/pull/1>.

Please note that this is a temporary fix, and we would revert this PR after Thymeleaf official released a new version including my fix.

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/7289

#### Special notes for your reviewer:

1. Execute command ab -c 100 -n 1000 -H 'Accept: text/html' -H 'Cache-Control: no-cache' http://localhost:8090/ and then press Ctrl + C to stop the thread.
2. See logs in Halo

#### Does this PR introduce a user-facing change?

```release-note
修复在特定情况下模板引擎可能出现内存泄漏的问题
```
pull/7683/head
John Niang 2025-08-12 18:46:48 +08:00 committed by GitHub
parent 09cd1f7f74
commit 6f608f12aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -81,7 +81,14 @@ tasks.named('jar') {
}
dependencies {
implementation project(':api')
implementation(project(':api')) {
exclude group: 'org.thymeleaf', module: 'thymeleaf-spring6'
}
implementation 'org.thymeleaf:thymeleaf'
// Fix https://github.com/halo-dev/halo/issues/7289
// Build from https://github.com/halo-dev/thymeleaf/commit/097a51cbaae114c87973e5de4ae9b88115976221
implementation files('libs/thymeleaf-spring6-3.1.4-rc.1+halo.2.21.6.jar')
annotationProcessor platform(project(':platform:application'))
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"