MCPcopy
hub / github.com/codeaashu/claude-code / startMdmSettingsLoad

Function startMdmSettingsLoad

src/utils/settings/mdm/settings.ts:67–98  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

65 * startup so the subprocess runs in parallel with module loading.
66 */
67export function startMdmSettingsLoad(): void {
68 if (mdmLoadPromise) return
69 mdmLoadPromise = (async () => {
70 profileCheckpoint('mdm_load_start')
71 const startTime = Date.now()
72
73 // Use the startup raw read if cli.tsx fired it, otherwise fire a fresh one.
74 // Both paths produce the same RawReadResult; consumeRawReadResult parses it.
75 const rawPromise = getMdmRawReadPromise() ?? fireRawRead()
76 const { mdm, hkcu } = consumeRawReadResult(await rawPromise)
77 mdmCache = mdm
78 hkcuCache = hkcu
79 profileCheckpoint('mdm_load_end')
80
81 const duration = Date.now() - startTime
82 logForDebugging(`MDM settings load completed in ${duration}ms`)
83 if (Object.keys(mdm.settings).length > 0) {
84 logForDebugging(
85 `MDM settings found: ${Object.keys(mdm.settings).join(', ')}`,
86 )
87 try {
88 logForDiagnosticsNoPII('info', 'mdm_settings_loaded', {
89 duration_ms: duration,
90 key_count: Object.keys(mdm.settings).length,
91 error_count: mdm.errors.length,
92 })
93 } catch {
94 // Diagnostic logging is best-effort
95 }
96 }
97 })()
98}
99
100/**
101 * Await the in-flight MDM load. Call this before the first settings read.

Callers 1

ensureMdmSettingsLoadedFunction · 0.85

Calls 7

profileCheckpointFunction · 0.85
getMdmRawReadPromiseFunction · 0.85
fireRawReadFunction · 0.85
consumeRawReadResultFunction · 0.85
logForDebuggingFunction · 0.85
logForDiagnosticsNoPIIFunction · 0.85
keysMethod · 0.80

Tested by

no test coverage detected