()
| 1406 | let configReadingAllowed = false |
| 1407 | |
| 1408 | export function enableConfigs(): void { |
| 1409 | if (configReadingAllowed) { |
| 1410 | // Ensure this is idempotent |
| 1411 | return |
| 1412 | } |
| 1413 | |
| 1414 | const startTime = Date.now() |
| 1415 | logForDiagnosticsNoPII('info', 'enable_configs_started') |
| 1416 | |
| 1417 | // Any reads to configuration before this flag is set show an console warning |
| 1418 | // to prevent us from adding config reading during module initialization |
| 1419 | configReadingAllowed = true |
| 1420 | // We only check the global config because currently all the configs share a file |
| 1421 | getConfig( |
| 1422 | getGlobalNcodeFile(), |
| 1423 | createDefaultGlobalConfig, |
| 1424 | true /* throw on invalid */, |
| 1425 | ) |
| 1426 | |
| 1427 | logForDiagnosticsNoPII('info', 'enable_configs_completed', { |
| 1428 | duration_ms: Date.now() - startTime, |
| 1429 | }) |
| 1430 | } |
| 1431 | |
| 1432 | /** |
| 1433 | * Returns the directory where config backup files are stored. |
no test coverage detected