Skip to content

Commit

Permalink
fix(frontend): fetching job result (db schema) separatly if too big (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
alpetric authored Jan 30, 2025
1 parent 24a853b commit f29ee67
Showing 1 changed file with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -477,12 +477,27 @@ export async function getDbSchemas(
if (!testResult.success) {
console.error(testResult.result?.['error']?.['message'])
} else {
if (testResult.result === 'WINDMILL_TOO_BIG') {
console.info('Result is too big, fetching result separately')
const data = await JobService.getCompletedJobResult({
workspace,
id: job
})
testResult.result = data
}
if (resourceType !== undefined) {
if (resourceType !== 'graphql') {
const { processingFn } = scripts[resourceType]
const schema: any =
processingFn !== undefined ? processingFn(testResult.result) : testResult.result

let schema: any
try {
schema =
processingFn !== undefined ? processingFn(testResult.result) : testResult.result
} catch (e) {
console.error(e)
errorCallback('Error processing schema')
resolve()
return
}
const dbSchema = {
lang: resourceTypeToLang(resourceType) as SQLSchema['lang'],
schema,
Expand Down

0 comments on commit f29ee67

Please sign in to comment.