@@ -9,7 +9,6 @@ import { inject, injectable } from 'tsyringe';
99import { Clone } from '@sinclair/typebox/value' ;
1010import pointer , { type JsonObject } from 'json-pointer' ;
1111import { formatISO , parseISO } from 'date-fns' ;
12- import { Cache , createCache } from 'async-cache-dedupe' ;
1312import { get } from 'lodash' ;
1413import { paths , components } from '@openapi' ;
1514import type { Prettify } from '@common/interfaces' ;
@@ -36,39 +35,18 @@ type DefaultConfigToInsert = Parameters<ConfigManager['createConfig']>[0] & {
3635 visited : boolean ;
3736} ;
3837
39- interface FullConfigMetadataParams {
40- name : string ;
41- schemaId : string ;
42- version ?: number ;
43- }
44-
4538// Constants for configuration metadata
4639const MAX_RECURSION_DEPTH = 2 ;
4740
4841@injectable ( )
4942export class ConfigManager {
50- private readonly fullConfigCache : Cache & {
51- getMetadata : ( args : FullConfigMetadataParams ) => Promise < ConfigFullMetadata > ;
52- } ;
53-
5443 public constructor (
5544 @inject ( SERVICES . LOGGER ) private readonly logger : Logger ,
5645 @inject ( ConfigRepository ) private readonly configRepository : ConfigRepository ,
5746 @inject ( Validator ) private readonly configValidator : Validator ,
5847 @inject ( HashPropagationHelper ) private readonly hashPropagationHelper : HashPropagationHelper ,
5948 @inject ( SchemaManager ) private readonly schemaManager : SchemaManager
60- ) {
61- // Initialize async-cache-dedupe for full config metadata
62- const cache = createCache ( {
63- ttl : 300 , // 5 minutes in seconds
64- storage : { type : 'memory' } ,
65- } ) ;
66-
67- // Define cached function for full config metadata
68- this . fullConfigCache = cache . define ( 'getMetadata' , async ( params : FullConfigMetadataParams ) => {
69- return this . generateFullConfigMetadata ( params . name , params . schemaId , params . version ) ;
70- } ) ;
71- }
49+ ) { }
7250
7351 @withSpan ( )
7452 public async getConfig ( name : string , schemaId : string , version ?: number , shouldDereferenceConfig ?: boolean ) : Promise < Config > {
@@ -803,11 +781,10 @@ export class ConfigManager {
803781 }
804782
805783 /**
806- * Generate comprehensive config metadata (uncached)
807- * Internal method used by cached getFullConfigMetadata
784+ * Get comprehensive config metadata for inspector page
808785 */
809786 @withSpan ( )
810- private async generateFullConfigMetadata ( name : string , schemaId : string , version ?: number ) : Promise < ConfigFullMetadata > {
787+ public async getFullConfigMetadata ( name : string , schemaId : string , version ?: number ) : Promise < ConfigFullMetadata > {
811788 this . logger . info ( { msg : 'Generating full config metadata' , name, schemaId, version } ) ;
812789
813790 // 1. Fetch raw and resolved config in parallel
@@ -894,12 +871,4 @@ export class ConfigManager {
894871
895872 return metadata ;
896873 }
897-
898- /**
899- * Get comprehensive config metadata for inspector page (cached)
900- */
901- @withSpan ( )
902- public async getFullConfigMetadata ( name : string , schemaId : string , version ?: number ) : Promise < ConfigFullMetadata > {
903- return this . fullConfigCache . getMetadata ( { name, schemaId, version } ) ;
904- }
905874}
0 commit comments