Revert " feat(db): web和gm添加只读库支持"

This reverts commit 5564a8363de57d8082b60a3a2255709aab957019.
This commit is contained in:
luying
2023-05-08 10:00:05 +08:00
parent 41ae7afec9
commit 2d45b2c66c
8 changed files with 2 additions and 62 deletions

View File

@@ -2,7 +2,7 @@ import 'reflect-metadata'
import * as mongoose from 'mongoose';
import { Application, IBoot } from 'egg';
import { connectRedis } from './app/pubUtils/redis';
import { loadGmDb, loadRODb, loadSubDb } from '@db/index';
import { loadGmDb, loadSubDb } from '@db/index';
import { SDK_TA_CONST, THINKING_DATA_MODE, THINKING_DATA_MODE_LIST } from '@consts';
const ThinkingAnalytics = require("thinkingdata-node");
@@ -20,7 +20,6 @@ export default class FooBoot implements IBoot {
await this.connectDB(this.app);
await this.connectGMDB(this.app);
await this.connectSubDB(this.app);
await this.connectRODB(this.app);
await this.connectRedis(this.app);
this.app.config.realEnv = this.app.config.env;
@@ -105,20 +104,6 @@ export default class FooBoot implements IBoot {
}
}
public async connectRODB(app: Application) {
const { url, options } = app.config.romongoose||app.config.mongoose
try {
if (url) {
const connection = await mongoose.createConnection(url, options)
app.context.connectionRO = connection;
loadRODb(connection);
console.log('******connectSubDB suc', url, options)
}
} catch(e) {
console.log(e)
}
}
public async connectRedis(app: Application) {
const { url, pw } = app.config.redis
if (url) {