We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d9a617c + c293689 commit b1c9f14Copy full SHA for b1c9f14
src/service/databaseManager.ts
@@ -28,14 +28,14 @@ export default class DatabaseManager {
28
return DatabaseManager.instance;
29
}
30
31
- public getTenantDb(tenantId: Snowflake): Connection {
+ public async getTenantDb(tenantId: Snowflake): Promise<Connection> {
32
const dbName = tenantId;
33
const db = mongoose.connection.useDb(dbName, { useCache: true });
34
- this.setupModels(db);
+ await this.setupModels(db);
35
return db;
36
37
38
- private setupModels(db: Connection): void {
+ private async setupModels(db: Connection): Promise<void> {
39
if (!this.modelCache[db.name]) {
40
db.model<IHeatMap>('HeatMap', heatMapSchema);
41
db.model<IRawInfo>('RawInfo', rawInfoSchema);
0 commit comments