mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
🎨 Change rhy result cache time to 24 hours if on the docker
This commit is contained in:
parent
19ed48a05c
commit
944180f9cc
1 changed files with 6 additions and 1 deletions
|
|
@ -32,8 +32,13 @@ func GetRhyResult(force bool) (map[string]interface{}, error) {
|
|||
rhyResultLock.Lock()
|
||||
defer rhyResultLock.Unlock()
|
||||
|
||||
cacheDuration := int64(3600)
|
||||
if ContainerDocker == Container {
|
||||
cacheDuration = int64(3600 * 24)
|
||||
}
|
||||
|
||||
now := time.Now().Unix()
|
||||
if 3600 >= now-rhyResultCacheTime && !force && 0 < len(cachedRhyResult) {
|
||||
if cacheDuration >= now-rhyResultCacheTime && !force && 0 < len(cachedRhyResult) {
|
||||
return cachedRhyResult, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue