Skip to content

Commit

Permalink
fix: session (#1455)
Browse files Browse the repository at this point in the history
* fix: session

* doc

* fix: i188n
  • Loading branch information
c121914yu committed May 13, 2024
1 parent ee8cb09 commit 59fd943
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 15 deletions.
7 changes: 7 additions & 0 deletions docSite/content/docs/development/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,13 @@ PG 数据库没有连接上/初始化失败,可以查看日志。FastGPT 会
2. 非 docker 部署的,需要手动安装 pg vector 插件
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
mongo连接失败,查看mongo的运行状态对应日志。
Expand Down
13 changes: 8 additions & 5 deletions files/deploy/fastgpt/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# 数据库的默认账号和密码仅首次运行时设置有效
# 如果修改了账号密码,记得改数据库和项目连接参数,别只改一处~
# 该配置文件只是给快速启动,测试使用。正式使用,记得务必修改账号密码,以及调整合适的知识库参数,共享内存等。
# 如何无法访问 dockerhub 和 git,可以用阿里云(阿里云没有arm包)

version: '3.3'
services:
pg:
# image: pgvector/pgvector:0.7.0-pg15 # docker hub
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:v0.7.0 # 阿里云
image: pgvector/pgvector:0.7.0-pg15 # docker hub
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:v0.7.0 # 阿里云
container_name: pg
restart: always
ports: # 生产环境建议不要暴露
Expand All @@ -21,7 +22,9 @@ services:
volumes:
- ./pg/data:/var/lib/postgresql/data
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
restart: always
ports:
Expand Down Expand Up @@ -66,8 +69,8 @@ services:
wait $$!
fastgpt:
container_name: fastgpt
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.7 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.7 # 阿里云
image: ghcr.io/labring/fastgpt:v4.8 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8 # 阿里云
ports:
- 3000:3000
networks:
Expand Down
4 changes: 2 additions & 2 deletions packages/service/common/mongo/sessionRun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ export const mongoSessionRun = async <T = unknown>(fn: (session: ClientSession)
const result = await fn(session);

await session.commitTransaction();
session.endSession();
await session.endSession();

return result as T;
} catch (error) {
console.log(error);

await session.abortTransaction();
session.endSession();
await session.endSession();
return Promise.reject(error);
}
};
9 changes: 5 additions & 4 deletions projects/app/i18n/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"App": "App",
"Export": "Export",
"Folder": "Folder",
"Login": "Login",
"Move": "Move",
"Name": "Name",
"New Create": "Create New",
"Rename": "Rename",
"Running": "Running",
"UnKnow": "Unknown",
"Warning": "Warning",
"New Create": "Create New",

"common": {
"Action": "Action",
"Add": "Add",
Expand Down Expand Up @@ -580,7 +580,8 @@
"success": "Start syncing"
}
},
"training": {}
"training": {
}
},
"data": {
"Auxiliary Data": "Auxiliary data",
Expand Down Expand Up @@ -863,10 +864,10 @@
"params": "Params"
},
"input": {
"Add Branch": "Add branch",
"Add Input": "Add input",
"Input Number": "Input: {{length}}",
"add": "Add condition",
"Add Branch": "Add branch",
"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.",
"HTTP Dynamic Input": "Receives the output value of the previous node as a variable, which can be used by HTTP request parameters.",
Expand Down
7 changes: 4 additions & 3 deletions projects/app/i18n/zh/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"App": "应用",
"Export": "导出",
"Folder": "文件夹",
"Login": "登录",
"Move": "移动",
"Name": "名称",
"New Create": "新建",
"Rename": "重命名",
"Running": "运行中",
"UnKnow": "未知",
"Warning": "提示",
"New Create": "新建",

"common": {
"Action": "操作",
"Add": "添加",
Expand Down Expand Up @@ -580,7 +580,8 @@
"success": "开始同步"
}
},
"training": {}
"training": {
}
},
"data": {
"Auxiliary Data": "辅助数据",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const LoginForm = ({ setPageType, loginSuccess }: Props) => {
isLoading={requesting}
onClick={handleSubmit(onclickLogin)}
>
{t('home.Login')}
{t('Login')}
</Button>

{feConfigs?.show_register && (
Expand Down

0 comments on commit 59fd943

Please sign in to comment.