From e009683a49a65e945ab054dbc5ec1ac3b035ce6d Mon Sep 17 00:00:00 2001 From: Vitalii Mikhailov Date: Mon, 2 Oct 2023 20:59:14 +0300 Subject: [PATCH] Fix --- .../Services/DatabaseMigrator.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/BUTR.CrashReportServer/Services/DatabaseMigrator.cs b/src/BUTR.CrashReportServer/Services/DatabaseMigrator.cs index 87bf262..8dc3413 100644 --- a/src/BUTR.CrashReportServer/Services/DatabaseMigrator.cs +++ b/src/BUTR.CrashReportServer/Services/DatabaseMigrator.cs @@ -69,7 +69,16 @@ await Parallel.ForEachAsync(Enumerable.Range(0, 4), options, async (_, ct2) => decompressed.Seek(0, SeekOrigin.Begin); decompressed.Seek(0, SeekOrigin.Begin); - var (valid, id, version, json) = await CrashReportRawParser.TryReadCrashReportDataAsync(PipeReader.Create(decompressed)); + var valid = false; + var version = 0; + try + { + var (valid2, id, version2, json) = await CrashReportRawParser.TryReadCrashReportDataAsync(PipeReader.Create(decompressed)); + valid = valid2; + version = version2; + } + catch (Exception) { } + if (valid) { sb.AppendLine($""" @@ -85,6 +94,8 @@ DELETE FROM id_entity WHERE file_id = '{entity.Id.FileId}'; DELETE FROM file_entity WHERE file_id = '{entity.Id.FileId}'; + DELETE FROM json_entity + WHERE file_id = '{entity.Id.FileId}'; """); } }