fix(backup): use active SQLite database and validate safe restore (U01)

This commit is contained in:
2026-11-02 06:21:24 +01:00
parent 317c696e70
commit a3c1bee09e
9 changed files with 269 additions and 56 deletions
@@ -0,0 +1,12 @@
namespace Duempelkas.Infrastructure.Services;
internal sealed class DatabaseLease(SemaphoreSlim? gate) : IDisposable
{
public static async Task<DatabaseLease> AcquireAsync(DatabaseLocation? location)
{
if (location != null) await location.Writes.WaitAsync();
return new DatabaseLease(location?.Writes);
}
public void Dispose() => gate?.Release();
}