Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Change rhy result cache time to 24 hours if on the docker

Daniel944180f9ccdf
diff --git a/kernel/util/rhy.go b/kernel/util/rhy.go
index b3937a1b50..4620bf5dd8 100644
--- a/kernel/util/rhy.go
+++ b/kernel/util/rhy.go
@@ -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
}