mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-20 19:10:49 +08:00
🎨 Change rhy result cache time to 24 hours if on the docker
This commit is contained in:
parent
19ed48a05c
commit
944180f9cc
@ -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…
Reference in New Issue
Block a user