File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
packages/app/src/server/utils Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 1010
1111import type { Tool } from '@modelcontextprotocol/sdk/types.js' ;
1212import { logger } from './logger.js' ;
13+ import { gradioMetrics } from './gradio-metrics.js' ;
1314import {
1415 spaceMetadataCache ,
1516 schemaCache ,
@@ -341,11 +342,16 @@ async function fetchSchema(
341342 clearTimeout ( timeoutId ) ;
342343 }
343344 } catch ( error ) {
344- logger . warn ( {
345- spaceName,
346- subdomain : metadata . subdomain ,
347- error : error instanceof Error ? error . message : String ( error ) ,
348- } , 'Failed to fetch schema' ) ;
345+ const isFirstError = gradioMetrics . schemaFetchError ( spaceName ) ;
346+ const logFn = isFirstError ? 'warn' : 'trace' ;
347+ logger [ logFn ] (
348+ {
349+ spaceName,
350+ subdomain : metadata . subdomain ,
351+ error : error instanceof Error ? error . message : String ( error ) ,
352+ } ,
353+ 'Failed to fetch schema'
354+ ) ;
349355
350356 return {
351357 success : false ,
You can’t perform that action at this time.
0 commit comments