MCPcopy
hub / github.com/compiler-explorer/compiler-explorer / onCompilerChange

Function onCompilerChange

lib/app/compiler-changes.ts:60–73  ·  view source on GitHub ↗

* Handle compiler change events * @param compilers - New set of compilers

(compilers: CompilerInfo[])

Source from the content-addressed store, hash-verified

58 * @param compilers - New set of compilers
59 */
60 async function onCompilerChange(compilers: CompilerInfo[]) {
61 const compilersAsJson = JSON.stringify(compilers);
62 if (prevCompilers === compilersAsJson) {
63 return;
64 }
65 logger.info(`Compiler scan count: ${compilers.length}`);
66 logger.debug('Compilers:', compilers);
67 prevCompilers = compilersAsJson;
68 await clientOptionsHandler.setCompilers(compilers);
69 const apiHandler = unwrap(routeApi.apiHandler);
70 apiHandler.setCompilers(compilers);
71 apiHandler.setLanguages(languages);
72 apiHandler.setOptions(clientOptionsHandler);
73 }
74
75 // Set initial compilers
76 await onCompilerChange(initialCompilers);

Callers 1

Calls 4

setLanguagesMethod · 0.80
setOptionsMethod · 0.80
unwrapFunction · 0.50
setCompilersMethod · 0.45

Tested by

no test coverage detected