File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @togethercrew.dev/db" ,
3- "version" : " 3.0.17 " ,
3+ "version" : " 3.0.18 " ,
44 "description" : " All interactions with DB" ,
55 "main" : " ./dist/index.js" ,
66 "types" : " ./dist/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -28,14 +28,14 @@ export default class DatabaseManager {
2828 return DatabaseManager . instance ;
2929 }
3030
31- public getTenantDb ( tenantId : Snowflake ) : Connection {
31+ public async getTenantDb ( tenantId : Snowflake ) : Promise < Connection > {
3232 const dbName = tenantId ;
3333 const db = mongoose . connection . useDb ( dbName , { useCache : true } ) ;
34- this . setupModels ( db ) ;
34+ await this . setupModels ( db ) ;
3535 return db ;
3636 }
3737
38- private setupModels ( db : Connection ) : void {
38+ private async setupModels ( db : Connection ) : Promise < void > {
3939 if ( ! this . modelCache [ db . name ] ) {
4040 db . model < IHeatMap > ( 'HeatMap' , heatMapSchema ) ;
4141 db . model < IRawInfo > ( 'RawInfo' , rawInfoSchema ) ;
You can’t perform that action at this time.
0 commit comments