mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 18:00:15 +01:00
refactor: original changes
This commit is contained in:
parent
fa9177180f
commit
f9c0e9853f
83 changed files with 413 additions and 505 deletions
|
|
@ -1,6 +1,5 @@
|
|||
require('dotenv').config();
|
||||
const mongoose = require('mongoose');
|
||||
const { registerModels } = require('@librechat/data-schemas');
|
||||
|
||||
if (!process.env.MONGO_URI) {
|
||||
throw new Error('Please define the MONGO_URI environment variable');
|
||||
|
|
@ -40,11 +39,6 @@ async function connectDb(mongoUri = process.env.MONGO_URI) {
|
|||
}
|
||||
cached.conn = await cached.promise;
|
||||
|
||||
// Register models once
|
||||
if (!cached.models) {
|
||||
cached.models = registerModels(mongoose);
|
||||
}
|
||||
|
||||
return cached.conn;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue