()
| 106 | } |
| 107 | |
| 108 | private async loadExistingCatalog(): Promise<boolean> { |
| 109 | try { |
| 110 | this.logger.debug("Loading existing catalog"); |
| 111 | this.catalog = await this.loadSpecCatalog(); |
| 112 | const specs = await Promise.all( |
| 113 | this.catalog.map((spec) => this.loadSpec(spec.uri.specId)) |
| 114 | ); |
| 115 | specs.forEach((spec, index) => { |
| 116 | const specId = this.catalog[index].uri.specId; |
| 117 | this.specs[specId] = spec; |
| 118 | this.specCache.set(specId, spec); |
| 119 | }); |
| 120 | this.logger.info("Successfully loaded existing catalog"); |
| 121 | return true; |
| 122 | } catch (error) { |
| 123 | this.logger.warn({ error }, "Failed to load existing catalog"); |
| 124 | this.resetState(); |
| 125 | return false; |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | public async initialize() { |
| 130 | this.logger.debug("Initializing FileSystemSpecService"); |
no test coverage detected