|
1 | 1 | import { Injectable, Logger, NotFoundException } from '@nestjs/common';
|
| 2 | +import { v4 as uuidv4 } from 'uuid'; |
2 | 3 | import { ConnectionType, HostingProvider } from 'src/modules/database/entities/database.entity';
|
3 | 4 | import { catchRedisConnectionError, getHostingProvider } from 'src/utils';
|
4 | 5 | import { Database } from 'src/modules/database/models/database';
|
@@ -35,7 +36,7 @@ export class DatabaseFactory {
|
35 | 36 | const client = await this.redisClientFactory.getConnectionStrategy().createStandaloneClient(
|
36 | 37 | {
|
37 | 38 | sessionMetadata,
|
38 |
| - databaseId: database.id || 'new', // we assume that if no database id defined we are in creation process |
| 39 | + databaseId: database.id || uuidv4(), // we assume that if no database id defined we are in creation process |
39 | 40 | context: ClientContext.Common,
|
40 | 41 | },
|
41 | 42 | database,
|
@@ -110,7 +111,7 @@ export class DatabaseFactory {
|
110 | 111 | const clusterClient = await this.redisClientFactory.getConnectionStrategy().createClusterClient(
|
111 | 112 | {
|
112 | 113 | sessionMetadata,
|
113 |
| - databaseId: model.id || 'new', // we assume that if no database id defined we are in creation process |
| 114 | + databaseId: model.id || uuidv4(), // we assume that if no database id defined we are in creation process |
114 | 115 | context: ClientContext.Common,
|
115 | 116 | },
|
116 | 117 | model,
|
@@ -157,7 +158,7 @@ export class DatabaseFactory {
|
157 | 158 | const sentinelClient = await this.redisClientFactory.getConnectionStrategy().createSentinelClient(
|
158 | 159 | {
|
159 | 160 | sessionMetadata,
|
160 |
| - databaseId: model.id || 'new', // we assume that if no database id defined we are in creation process |
| 161 | + databaseId: model.id || uuidv4(), // we assume that if no database id defined we are in creation process |
161 | 162 | context: ClientContext.Common,
|
162 | 163 | },
|
163 | 164 | model,
|
|
0 commit comments