Skip to content

Commit b1c9f14

Browse files
authored
Merge pull request #134 from TogetherCrew/fix-db-index-issue
[FIXBUG]
2 parents d9a617c + c293689 commit b1c9f14

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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)