Skip to content

Commit

Permalink
Merge branch 'main' into feat/test-case
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Ignacio Molteni <[email protected]>
  • Loading branch information
dalkia authored Feb 29, 2024
2 parents e1aafad + fb15e7a commit af9bbe6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ COPY --from=dotnet-build /build/publish/ .

WORKDIR /app

COPY RoadCoordinates.json ./
COPY ./pixyzsdk-29022024.lic ./pixyzsdk-29022024.lic
COPY --from=scene-lod-build /scene-lod/dist ./scene-lod/dist
COPY --from=scene-lod-build /scene-lod/package.json ./scene-lod/package.json
Expand Down
19 changes: 14 additions & 5 deletions consumer-server/src/logic/lod-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,22 @@ export function createLodGeneratorComponent(): LodGeneratorComponent {
outputPath: processOutput
}


const commandToExecute = `${lodGeneratorProgram} "coords" "${basePointer}" "${outputPath}" "${sceneLodEntitiesManifestBuilder}" "false" "false"`

result = await new Promise((resolve, _) => {
exec(commandToExecute, (error, _, stderr) => {
if (error || stderr) {
result.error = {
message: error?.message || 'Unexpected error',
detailedError: ((stderr as string) || '').replace('\n', ' ')
exec(commandToExecute, { timeout: 10 * 60 * 1000 }, (error, _, stderr) => {
if (error) {
if (error.killed) {
result.error = {
message: 'Operation timed out after 10 minutes',
detailedError: ((stderr as string) || '').replace('\n', ' ')
}
} else {
result.error = {
message: error?.message || 'Unexpected error',
detailedError: ((stderr as string) || '').replace('\n', ' ')
}
}
}

Expand Down
5 changes: 4 additions & 1 deletion consumer-server/src/logic/message-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ export function createMessageHandlerComponent({
base,
generatedFiles: result.lodsFiles.map((file) => file.split('/').pop()).join(', ')
})
logger.debug('LOD generation log', { logFile: fs.readFileSync(result.logFile, 'utf-8') })

if (result.logFile) {
logger.debug('LOD generation log', { logFile: fs.readFileSync(result.logFile, 'utf-8') })
}

if (result.error) {
logger.error('Error while generating LODs', { error: result.error.message || 'Unexpected failure' })
Expand Down

0 comments on commit af9bbe6

Please sign in to comment.