Skip to content

Commit c293689

Browse files
committed
[FIXBUG]
1 parent 248f62a commit c293689

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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",

src/service/databaseManager.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)