Compare commits

...

3 Commits

Author SHA1 Message Date
gotoeasy
cef1e64cab v0.17.6 2025-05-05 16:44:07 +08:00
gotoeasy
430aa6bbf1 取消chatai 2025-05-05 16:20:29 +08:00
gotoeasy
a086e48aae 优化缓存管理 2025-05-05 16:17:48 +08:00
8 changed files with 25 additions and 27 deletions

View File

@ -119,7 +119,6 @@ docker run -d -p 8080:8080 -e GLC_CLUSTER_MODE=true -e GLC_SERVER_URL=http://172
- [x] `GLC_BLACK_LIST`黑名单多个用逗号分隔黑白名单冲突时白名单优先默认空白。可设定IP最后段支持通配符如`1.2.3.*`,也支持单个通配符`*`代表全部也就是只允许内网或白名单指定使用实验性质的支持区域名称因为IP地域查询可能有误差
- [x] `GLC_IP_ADD_CITY`对IP字段是否自动附加城市信息默认`false`
- [x] `GLC_NEAR_SEARCH_SIZE`定位相邻检索时的检索件数默认200有效范围50-1000
- [x] `GLC_ENABLE_CHATAI`是否开启GLC智能助手默认true会在菜单栏显示
## 接口
@ -293,6 +292,12 @@ docker run -d -p --log-driver=fluentd --log-opt fluentd-address=192.168.169.170:
- [ ] 日志审计、告警
### 版本`0.17.6`
- [x] 取消智能助手AI发展引动难以满足的高期望值
- [x] 修复已知问题(#65、#70
### 版本`0.17.5`
- [x] 更新依赖包(#66

View File

@ -61,7 +61,6 @@ var tokenSalt string
var aryWhite []string
var aryBlack []string
var ipAddCity bool
var enableChatAi bool
func init() {
UpdateConfigByEnv()
@ -107,12 +106,6 @@ func UpdateConfigByEnv() {
nearSearchSize = getNearSearchSizeConf(cmn.GetEnvInt("GLC_NEAR_SEARCH_SIZE", 200)) // 定位相邻检索的查询件数默认200有效范围50~1000
mulitLineSearch = cmn.GetEnvBool("GLC_SEARCH_MULIT_LINE", false) // 是否检索日志的全部行日志可能有换行默认false仅第一行
testMode = cmn.GetEnvBool("GLC_TEST_MODE", false) // 是否测试模式默认false
enableChatAi = cmn.GetEnvBool("GLC_ENABLE_CHATAI", true) // 是否开启GLC智能助手默认true
}
// 取配置: 是否开启GLC智能助手
func IsEnableChatAi() bool {
return enableChatAi
}
// 取配置: 定位相邻检索的查询件数可通过环境变量“GLC_NEAR_SEARCH_SIZE”设定默认200件

View File

@ -240,6 +240,7 @@ func (s *WordIndexStorage) Close() {
idxMu.Lock() // map锁
defer idxMu.Unlock() // map解锁
mapStorage.Delete(s.storeName) // 设空下回GetStorage时自动再创建
s.mapWordCounter.Clear() // 清空辅助回收
cmn.Info("关闭WordIndexStorage", s.storeName+cmn.PathSeparator()+s.subPath)
}

View File

@ -14,6 +14,7 @@ import (
)
var mapStorageHandle sync.Map
var mapStorageMu sync.Mutex
// 日志存储结构体
type LogDataStorageHandle struct {
@ -30,6 +31,21 @@ func NewLogDataStorageHandle(storeName string) *LogDataStorageHandle {
}
}
// 删除缓存中已关闭的存储对象
mapStorageMu.Lock()
defer mapStorageMu.Unlock()
var delKeys []any
mapStorageHandle.Range(func(key, value any) bool {
s := value.(*LogDataStorageHandle)
if s.storage.IsClose() {
delKeys = append(delKeys, key)
}
return true
})
for _, key := range delKeys {
mapStorageHandle.Delete(key)
}
store := &LogDataStorageHandle{
storage: logdata.NewLogDataStorage(storeName),
}

View File

@ -57,7 +57,6 @@ func Run() {
gweb.RegisterController(method.POST, contextPath+conf.SysUserTransferChgPsw, controller.UserTransferChangePswController) // [用户]转发修改自己密码
gweb.RegisterController(method.POST, contextPath+conf.SysUserTransferSave, controller.UserTransferSaveController) // [用户]转发保存
gweb.RegisterController(method.POST, contextPath+conf.SysUserTransferDel, controller.UserTransferDelController) // [用户]转发删除
gweb.RegisterController(method.POST, contextPath+"/v1/sys/chatai", controller.ChatAiController) // 查询是否开启智能助手
// 集群操作接口
gweb.RegisterController(method.POST, contextPath+"/sys/cluster/info", controller.ClusterGetClusterInfoController) // 获取集群信息

View File

@ -1,4 +1,4 @@
package ver
// 版本号,升级版本时修改
const VERSION = "v0.17.5"
const VERSION = "v0.17.6"

View File

@ -16,11 +16,6 @@ import (
var glcLatest string = ""
var glcOrigin string = ""
// 查询是否开启智能助手
func ChatAiController(req *gweb.HttpRequest) *gweb.HttpResult {
return gweb.Result(conf.IsEnableChatAi())
}
// 查询是否测试模式
func TestModeController(req *gweb.HttpRequest) *gweb.HttpResult {
return gweb.Result(conf.IsTestMode())

View File

@ -60,7 +60,7 @@ export const getUserMenu = async () => {
openInner: true,
});
let rs = await $post('/v1/user/enableLogin', {}, null, { 'Content-Type': 'application/x-www-form-urlencoded' });
const rs = await $post('/v1/user/enableLogin', {}, null, { 'Content-Type': 'application/x-www-form-urlencoded' });
if (rs.success && rs.result) {
menus.push({
path: '/glc/sysuser',
@ -72,16 +72,5 @@ export const getUserMenu = async () => {
});
}
rs = await $post('/v1/sys/chatai', {}, null, { 'Content-Type': 'application/x-www-form-urlencoded' });
if (rs.success && rs.result) {
menus.push({
path: '/glc/chatai',
title: 'GLC智能助手',
icon: 'ai',
component: 'https://ai.youdao.com/saas/qanything/#/bots/C9BA280AA796491F/share',
openInner: true,
});
}
return (menuState.aryMenu = menus);
};