MCPcopy Create free account
hub / github.com/chokcoco/iCSS / waitForReady

Method waitForReady

MCP/debug-local.js:146–166  ·  view source on GitHub ↗
(timeout = 10000)

Source from the content-addressed store, hash-verified

144 }
145
146 async waitForReady(timeout = 10000) {
147 debugLog(`⏳ Waiting for server to be ready (timeout: ${timeout}ms)`);
148 const startTime = Date.now();
149
150 while (!this.isReady && !this.dbInitFailed) {
151 if (Date.now() - startTime > timeout) {
152 throw new McpError(
153 ErrorCode.InternalError,
154 'Server initialization timeout'
155 );
156 }
157 await new Promise(resolve => setTimeout(resolve, 100));
158 }
159
160 if (this.dbInitFailed) {
161 throw new McpError(
162 ErrorCode.InternalError,
163 'Server initialization failed'
164 );
165 }
166 }
167
168 setupHandlers() {
169 debugLog('🔗 Setting up request handlers...');

Callers 1

setupHandlersMethod · 0.95

Calls 1

debugLogFunction · 0.70

Tested by

no test coverage detected