Skip to content

Commit

Permalink
fix(server): support random uuids
Browse files Browse the repository at this point in the history
  • Loading branch information
jrea committed Sep 30, 2024
1 parent bbc75bf commit 2a04619
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/server/src/db/DBManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ export default class DBManager {

getConnection = (config: ServerConfig): Pool => {
const { info } = Logger(config, '[DBManager]');
const id = this.makeId(config.tenantId, config.userId);
let id = this.makeId(config.tenantId, config.userId);
if (id === 'base' && (config.tenantId || config.userId)) {
info('tenantId or useId unable to be validated, creating new connection');
id = crypto.randomUUID();
}

const existing = this.connections.get(id);
info('# of instances:', this.connections.size);
if (existing) {
Expand Down

0 comments on commit 2a04619

Please sign in to comment.