4.8.8 test fix (#2149)

* perf: code comment

* feat: system plugin input guide

* perf: variable avatar

* feat: feishu webhook

* perf: select tool config tip

* perf: rename variable

* fix: per inherit error

* perf: docker-compose oneapi version and i18n

* perf: ui tip bug

* fix: ts

* perf: pg log

* perf: editor color

* perf: update init
This commit is contained in:
Archer
2024-07-26 10:23:44 +08:00
committed by GitHub
parent 2d016b7462
commit cd554f573e
59 changed files with 1648 additions and 506 deletions

View File

@@ -47,8 +47,6 @@ const addCommonMiddleware = (schema: mongoose.Schema) => {
if (duration > 1000) {
addLog.warn(`Slow operation ${duration}ms`, warnLogData);
} else if (duration > 3000) {
addLog.error(`Slow operation ${duration}ms`, warnLogData);
}
}
next();

View File

@@ -1,3 +1,4 @@
import { delay } from '@fastgpt/global/common/system/utils';
import { addLog } from '../system/log';
import { connectionMongo } from './index';
import type { Mongoose } from 'mongoose';
@@ -17,9 +18,11 @@ export async function connectMongo(): Promise<Mongoose> {
try {
connectionMongo.set('strictQuery', true);
connectionMongo.connection.on('error', (error) => {
connectionMongo.connection.on('error', async (error) => {
console.log('mongo error', error);
connectionMongo.disconnect();
await connectionMongo.disconnect();
await delay(1000);
connectMongo();
});
connectionMongo.connection.on('disconnected', () => {
console.log('mongo disconnected');
@@ -44,8 +47,10 @@ export async function connectMongo(): Promise<Mongoose> {
console.log('mongo connected');
} catch (error) {
connectionMongo.disconnect();
addLog.error('mongo connect error', error);
await connectionMongo.disconnect();
await delay(1000);
connectMongo();
}
return connectionMongo;