fix: session (#1455)

* fix: session

* doc

* fix: i188n
This commit is contained in:
Archer
2024-05-13 11:04:50 +08:00
committed by GitHub
parent ee8cb0915e
commit 59fd94384d
6 changed files with 27 additions and 15 deletions

View File

@@ -257,6 +257,13 @@ PG 数据库没有连接上/初始化失败可以查看日志。FastGPT 会
2. 非 docker 部署的,需要手动安装 pg vector 插件 2. 非 docker 部署的,需要手动安装 pg vector 插件
3. 查看 fastgpt 日志,有没有相关报错 3. 查看 fastgpt 日志,有没有相关报错
### Illegal instruction
可能原因:
1. arm架构。需要使用 Mongo 官方镜像: mongo:5.0.18
2. cpu 不支持 AVX无法用 mongo5需要换成 mongo4.x。把 mongo 的 image 换成: mongo:4.4.29
### Operation `auth_codes.findOne()` buffering timed out after 10000ms ### Operation `auth_codes.findOne()` buffering timed out after 10000ms
mongo连接失败查看mongo的运行状态对应日志。 mongo连接失败查看mongo的运行状态对应日志。

View File

@@ -1,12 +1,13 @@
# 数据库的默认账号和密码仅首次运行时设置有效 # 数据库的默认账号和密码仅首次运行时设置有效
# 如果修改了账号密码,记得改数据库和项目连接参数,别只改一处~ # 如果修改了账号密码,记得改数据库和项目连接参数,别只改一处~
# 该配置文件只是给快速启动,测试使用。正式使用,记得务必修改账号密码,以及调整合适的知识库参数,共享内存等。 # 该配置文件只是给快速启动,测试使用。正式使用,记得务必修改账号密码,以及调整合适的知识库参数,共享内存等。
# 如何无法访问 dockerhub 和 git可以用阿里云阿里云没有arm包
version: '3.3' version: '3.3'
services: services:
pg: pg:
# image: pgvector/pgvector:0.7.0-pg15 # docker hub image: pgvector/pgvector:0.7.0-pg15 # docker hub
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:v0.7.0 # 阿里云 # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:v0.7.0 # 阿里云
container_name: pg container_name: pg
restart: always restart: always
ports: # 生产环境建议不要暴露 ports: # 生产环境建议不要暴露
@@ -21,7 +22,9 @@ services:
volumes: volumes:
- ./pg/data:/var/lib/postgresql/data - ./pg/data:/var/lib/postgresql/data
mongo: mongo:
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/mongo:5.0.18 image: mongo:5.0.18 # dockerhub
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/mongo:5.0.18 # 阿里云
# image: mongo:4.4.29 # cpu不支持AVX时候使用
container_name: mongo container_name: mongo
restart: always restart: always
ports: ports:
@@ -66,8 +69,8 @@ services:
wait $$! wait $$!
fastgpt: fastgpt:
container_name: fastgpt container_name: fastgpt
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.7 # git image: ghcr.io/labring/fastgpt:v4.8 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.7 # 阿里云 # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8 # 阿里云
ports: ports:
- 3000:3000 - 3000:3000
networks: networks:

View File

@@ -8,14 +8,14 @@ export const mongoSessionRun = async <T = unknown>(fn: (session: ClientSession)
const result = await fn(session); const result = await fn(session);
await session.commitTransaction(); await session.commitTransaction();
session.endSession(); await session.endSession();
return result as T; return result as T;
} catch (error) { } catch (error) {
console.log(error); console.log(error);
await session.abortTransaction(); await session.abortTransaction();
session.endSession(); await session.endSession();
return Promise.reject(error); return Promise.reject(error);
} }
}; };

View File

@@ -2,14 +2,14 @@
"App": "App", "App": "App",
"Export": "Export", "Export": "Export",
"Folder": "Folder", "Folder": "Folder",
"Login": "Login",
"Move": "Move", "Move": "Move",
"Name": "Name", "Name": "Name",
"New Create": "Create New",
"Rename": "Rename", "Rename": "Rename",
"Running": "Running", "Running": "Running",
"UnKnow": "Unknown", "UnKnow": "Unknown",
"Warning": "Warning", "Warning": "Warning",
"New Create": "Create New",
"common": { "common": {
"Action": "Action", "Action": "Action",
"Add": "Add", "Add": "Add",
@@ -580,7 +580,8 @@
"success": "Start syncing" "success": "Start syncing"
} }
}, },
"training": {} "training": {
}
}, },
"data": { "data": {
"Auxiliary Data": "Auxiliary data", "Auxiliary Data": "Auxiliary data",
@@ -863,10 +864,10 @@
"params": "Params" "params": "Params"
}, },
"input": { "input": {
"Add Branch": "Add branch",
"Add Input": "Add input", "Add Input": "Add input",
"Input Number": "Input: {{length}}", "Input Number": "Input: {{length}}",
"add": "Add condition", "add": "Add condition",
"Add Branch": "Add branch",
"description": { "description": {
"Background": "You can add some specific content introductions to better identify the user's question type. This content is usually to introduce something unknown to the model.", "Background": "You can add some specific content introductions to better identify the user's question type. This content is usually to introduce something unknown to the model.",
"HTTP Dynamic Input": "Receives the output value of the previous node as a variable, which can be used by HTTP request parameters.", "HTTP Dynamic Input": "Receives the output value of the previous node as a variable, which can be used by HTTP request parameters.",

View File

@@ -2,14 +2,14 @@
"App": "应用", "App": "应用",
"Export": "导出", "Export": "导出",
"Folder": "文件夹", "Folder": "文件夹",
"Login": "登录",
"Move": "移动", "Move": "移动",
"Name": "名称", "Name": "名称",
"New Create": "新建",
"Rename": "重命名", "Rename": "重命名",
"Running": "运行中", "Running": "运行中",
"UnKnow": "未知", "UnKnow": "未知",
"Warning": "提示", "Warning": "提示",
"New Create": "新建",
"common": { "common": {
"Action": "操作", "Action": "操作",
"Add": "添加", "Add": "添加",
@@ -580,7 +580,8 @@
"success": "开始同步" "success": "开始同步"
} }
}, },
"training": {} "training": {
}
}, },
"data": { "data": {
"Auxiliary Data": "辅助数据", "Auxiliary Data": "辅助数据",

View File

@@ -137,7 +137,7 @@ const LoginForm = ({ setPageType, loginSuccess }: Props) => {
isLoading={requesting} isLoading={requesting}
onClick={handleSubmit(onclickLogin)} onClick={handleSubmit(onclickLogin)}
> >
{t('home.Login')} {t('Login')}
</Button> </Button>
{feConfigs?.show_register && ( {feConfigs?.show_register && (