From 940d4077ffcfc99494eb6fac87cd8978089c70ca Mon Sep 17 00:00:00 2001 From: Carl Johnsen Date: Mon, 19 May 2025 20:31:37 +0200 Subject: [PATCH] Changed LocalBugReportDatabase to use factory construction --- .../Main/Database/LocalBugReportDatabase.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Duplicati/Library/Main/Database/LocalBugReportDatabase.cs b/Duplicati/Library/Main/Database/LocalBugReportDatabase.cs index 29fab2f73..0e5eec8f6 100644 --- a/Duplicati/Library/Main/Database/LocalBugReportDatabase.cs +++ b/Duplicati/Library/Main/Database/LocalBugReportDatabase.cs @@ -22,6 +22,7 @@ #nullable enable using System; +using System.Threading.Tasks; using Duplicati.Library.Common.IO; namespace Duplicati.Library.Main.Database @@ -33,16 +34,16 @@ namespace Duplicati.Library.Main.Database /// private static readonly string LOGTAG = Logging.Log.LogTagFromType(typeof(LocalBugReportDatabase)); - public LocalBugReportDatabase(string path, long pagecachesize) - : base(path, "BugReportCreate", false, pagecachesize) + public static async Task CreateAsync(string path, long pagecachesize) { - ShouldCloseConnection = true; + var db = new LocalBugReportDatabase(); + + db = (LocalBugReportDatabase)await CreateLocalDatabaseAsync(db, path, "BugReportCreate", false, pagecachesize); + db.ShouldCloseConnection = true; + + return db; } - public void Fix() - { - using (var tr = m_connection.BeginTransactionSafe()) - using (var cmd = m_connection.CreateCommand()) { cmd.Transaction = tr; var tablename = "PathMap-" + Library.Utility.Utility.ByteArrayAsHexString(Guid.NewGuid().ToByteArray());