Added extra info logs to file import service

This commit is contained in:
Jedd Morgan
2025-03-13 13:49:23 +00:00
parent d122873f0e
commit 3404645d6c
2 changed files with 9 additions and 2 deletions
@@ -2,6 +2,7 @@
using System.Text.Json;
using Speckle.Importers.Ifc;
using Speckle.Sdk.Common;
using Speckle.Sdk.Models.Extensions;
var filePathArgument = new Argument<string>(name: "filePath");
var outputPathArgument = new Argument<string>("outputPath");
@@ -31,9 +32,11 @@ rootCommand.SetHandler(
}
catch (Exception e)
{
Console.WriteLine($"IFC Importer failed with exception {e.ToFormattedString()}");
File.WriteAllText(
outputPath,
JsonSerializer.Serialize(new { success = false, error = e.ToString() })
JsonSerializer.Serialize(new { success = false, error = e.ToFormattedString() })
);
}
},
+5 -1
View File
@@ -121,6 +121,8 @@ async function doTask(mainDb, regionName, taskDb, task) {
})
tempUserToken = token
taskLogger.info("Downloading file {fileId}")
await downloadFile({
fileId: info.id,
streamId: info.streamId,
@@ -128,6 +130,8 @@ async function doTask(mainDb, regionName, taskDb, task) {
destination: TMP_FILE_PATH
})
taskLogger.info("Triggering importer for {fileType}")
if (info.fileType.toLowerCase() === 'ifc') {
if (FF_FILEIMPORT_IFC_DOTNET_ENABLED) {
await runProcessWithTimeout(
@@ -243,7 +247,7 @@ async function doTask(mainDb, regionName, taskDb, task) {
[commitId, task.id]
)
} catch (err) {
taskLogger.error(err)
taskLogger.error(err, "error while doing task")
await taskDb.raw(
`
UPDATE file_uploads