* lock

* perf: init data

* perf: vision model url

* fix: chat index
This commit is contained in:
Archer
2024-07-17 00:16:57 +08:00
committed by GitHub
parent fc96bb99cc
commit 36f8755d09
26 changed files with 693 additions and 905 deletions

View File

@@ -1,3 +1,4 @@
import { exit } from 'process';
import { addLog } from '../system/log';
import { connectionMongo } from './index';
import type { Mongoose } from 'mongoose';
@@ -56,9 +57,13 @@ export async function connectMongo({
}
try {
afterHook && (await afterHook());
if (!global.systemInited) {
global.systemInited = true;
afterHook && (await afterHook());
}
} catch (error) {
addLog.error('mongo connect after hook error', error);
addLog.error('Mongo connect after hook error', error);
exit(1);
}
return connectionMongo;