Skip to content

Commit

Permalink
fix: handle error while creating lods (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
aleortega authored Feb 5, 2024
1 parent 43826cf commit c025211
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion consumer-server/src/adapters/memory-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { AppComponents, QueueService } from '../types'

export function createMemoryQueueAdapter({ logs }: Pick<AppComponents, 'logs'>): QueueService {
const logger = logs.getLogger('memory-queue')
const queue = new AsyncQueue((action) => void 0)
const queue = new AsyncQueue((_) => void 0)

logger.info('Initializing memory queue adapter')

Expand Down
4 changes: 2 additions & 2 deletions consumer-server/src/logic/lod-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ export function createLodGeneratorComponent(): LodGeneratorService {

const commandToExecute = `${lodGeneratorProgram} "coords" "${basePointer}" ${sceneLodEntitiesManifestBuilder} "${outputPath}"`
const files: string[] = await new Promise((resolve, reject) => {
exec(commandToExecute, (_error, _stdout, _stderr) => {
exec(commandToExecute, (error, _stdout, stderr) => {
const generatedFiles = fs.readdirSync(outputPath)
// if files exists return otherwise reject
if (generatedFiles.length > 0) {
resolve(generatedFiles)
} else {
reject('Could not generate LODs')
reject(new Error(`No files were generated. Error: ${error?.message}, Stderr: ${stderr}`))
}
})
})
Expand Down

0 comments on commit c025211

Please sign in to comment.