Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2026-01-04 20:31:26 +08:00
commit 27810da357
8 changed files with 21 additions and 14 deletions

File diff suppressed because one or more lines are too long

View file

@ -575,7 +575,7 @@ func getStageIndex(pkgType string) (ret *StageIndex, err error) {
defer stageIndexLock.Unlock()
now := time.Now().Unix()
if 3600 >= now-stageIndexCacheTime && nil != cachedStageIndex[pkgType] {
if util.RhyCacheDuration >= now-stageIndexCacheTime && nil != cachedStageIndex[pkgType] {
ret = cachedStageIndex[pkgType]
return
}

View file

@ -8,7 +8,7 @@ require (
github.com/88250/epub v0.0.0-20230830085737-c19055cd1f48
github.com/88250/go-humanize v0.0.0-20240424102817-4f78fac47ea7
github.com/88250/gulu v1.2.3-0.20251208021445-f93f2666eaac
github.com/88250/lute v1.7.7-0.20260103021733-9fd554ae3f44
github.com/88250/lute v1.7.7-0.20260104085649-d01ee1896e5f
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1
github.com/ClarkThan/ahocorasick v0.0.0-20231011042242-30d1ef1347f4
github.com/ConradIrwin/font v0.2.1

View file

@ -14,8 +14,8 @@ github.com/88250/go-sqlite3 v1.14.13-0.20231214121541-e7f54c482950 h1:Pa5hMiBceT
github.com/88250/go-sqlite3 v1.14.13-0.20231214121541-e7f54c482950/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/88250/gulu v1.2.3-0.20251208021445-f93f2666eaac h1:EC80pY8zyR0gbL8ZLIBB4IPG/ia3ZHScrR/xt8zU8qU=
github.com/88250/gulu v1.2.3-0.20251208021445-f93f2666eaac/go.mod h1:IQ5dXW9CjVmx6B7OfK1Y4ZBKTPMe9q1AkVoLGGzRbS8=
github.com/88250/lute v1.7.7-0.20260103021733-9fd554ae3f44 h1:ax+JaNRNpyH3MnisUepYgw5Eid/YdB7oqAmbptHwIBk=
github.com/88250/lute v1.7.7-0.20260103021733-9fd554ae3f44/go.mod h1:WYyUw//5yVw9BJnoVjx7rI/3szsISxNZCYGOqTIrV0o=
github.com/88250/lute v1.7.7-0.20260104085649-d01ee1896e5f h1:gMGN1BPb+80iewKVsVCdoFGLLJCYqqDe/NSq7YhfE1I=
github.com/88250/lute v1.7.7-0.20260104085649-d01ee1896e5f/go.mod h1:WYyUw//5yVw9BJnoVjx7rI/3szsISxNZCYGOqTIrV0o=
github.com/88250/pdfcpu v0.3.14-0.20250424122812-f10e8d9d8d46 h1:Bq1JsDfVbHKUxNL/B2JXd8cC/1h6aFjrlXpGycnh0Hk=
github.com/88250/pdfcpu v0.3.14-0.20250424122812-f10e8d9d8d46/go.mod h1:fVfOloBzs2+W2VJCCbq60XIxc3yJHAZ0Gahv1oO0gyI=
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 h1:48T899JQDwyyRu9yXHePYlPdHtpJfrJEUGBMH3SMBWY=

View file

@ -33,7 +33,8 @@ func StartCron() {
go every(5*time.Second, model.SyncDataJob)
go every(2*time.Hour, model.StatJob)
go every(6*time.Hour, util.RefreshRhyResultJob, "RefreshRhyResultJob")
go every(2*time.Hour, model.RefreshCheckJob)
go every(2*time.Hour, model.RefreshCheckJob2H)
go every(6*time.Hour, model.RefreshCheckJob6H)
go every(3*time.Second, model.FlushUpdateRefTextRenameDocJob)
go every(util.SQLFlushInterval, sql.FlushTxJob)
go every(util.SQLFlushInterval, sql.FlushHistoryTxJob)

View file

@ -214,10 +214,13 @@ var (
subscriptionExpirationReminded bool
)
func RefreshCheckJob() {
func RefreshCheckJob2H() {
go refreshSubscriptionExpirationRemind()
go refreshUser()
go refreshAnnouncement()
}
func RefreshCheckJob6H() {
go refreshCheckDownloadInstallPkg()
}

View file

@ -374,7 +374,7 @@ func RenderTemplate(p, id string, preview bool) (tree *parse.Tree, dom string, e
if (ast.NodeListItem == n.Type && (nil == n.FirstChild ||
(3 == n.ListData.Typ && (nil == n.FirstChild.Next || ast.NodeKramdownBlockIAL == n.FirstChild.Next.Type)))) ||
(ast.NodeBlockquote == n.Type && nil != n.FirstChild && nil != n.FirstChild.Next && ast.NodeKramdownBlockIAL == n.FirstChild.Next.Type) ||
(ast.NodeCallout == n.Type && nil != n.FirstChild && ast.NodeKramdownBlockIAL == n.FirstChild.Next.Type) {
(ast.NodeCallout == n.Type && nil != n.FirstChild && ast.NodeKramdownBlockIAL == n.FirstChild.Type) {
nodesNeedAppendChild = append(nodesNeedAppendChild, n)
}

View file

@ -26,21 +26,24 @@ import (
"github.com/siyuan-note/logging"
)
var cachedRhyResult = map[string]interface{}{}
var rhyResultCacheTime int64
var rhyResultLock = sync.Mutex{}
var (
RhyCacheDuration = int64(3600 * 6)
cachedRhyResult = map[string]interface{}{}
rhyResultCacheTime int64
rhyResultLock = sync.Mutex{}
)
func GetRhyResult(force bool) (map[string]interface{}, error) {
rhyResultLock.Lock()
defer rhyResultLock.Unlock()
cacheDuration := int64(3600 * 6)
if ContainerDocker == Container {
cacheDuration = int64(3600 * 24)
RhyCacheDuration = int64(3600 * 24)
}
now := time.Now().Unix()
if cacheDuration >= now-rhyResultCacheTime && !force && 0 < len(cachedRhyResult) {
if RhyCacheDuration >= now-rhyResultCacheTime && !force && 0 < len(cachedRhyResult) {
return cachedRhyResult, nil
}