mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
feat(core): use deterministic uuids if absolutely necessary
This commit is contained in:
@@ -30,11 +30,11 @@ import {
|
||||
import { createContextId } from '../helpers/context-id-factory';
|
||||
import { getClassScope } from '../helpers/get-class-scope';
|
||||
import { isDurable } from '../helpers/is-durable';
|
||||
import { DeterministicUuidRegistry } from '../inspector/deterministic-uuid-registry';
|
||||
import { UuidFactory } from '../inspector/uuid-factory';
|
||||
import { CONTROLLER_ID_KEY } from './constants';
|
||||
import { NestContainer } from './container';
|
||||
import { InstanceWrapper } from './instance-wrapper';
|
||||
import { ModuleRefGetOrResolveOpts, ModuleRef } from './module-ref';
|
||||
import { ModuleRef, ModuleRefGetOrResolveOpts } from './module-ref';
|
||||
|
||||
/**
|
||||
* @note
|
||||
@@ -626,8 +626,6 @@ export class Module {
|
||||
private generateUuid(): string {
|
||||
const UUID_NAMESPACE = 'fb848993-0c82-4b9e-ae95-3c3c1dbe3d6b';
|
||||
const key = this.name?.toString() ?? this.token?.toString();
|
||||
return key
|
||||
? DeterministicUuidRegistry.get(key, UUID_NAMESPACE)
|
||||
: randomStringGenerator();
|
||||
return key ? UuidFactory.get(key, UUID_NAMESPACE) : randomStringGenerator();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user