diff --git a/csharp/App/Backend/Database/Db.cs b/csharp/App/Backend/Database/Db.cs index e9cb827ca..d9d5ae1cd 100644 --- a/csharp/App/Backend/Database/Db.cs +++ b/csharp/App/Backend/Database/Db.cs @@ -16,20 +16,21 @@ public static partial class Db private static SQLiteConnection Connection { get; } = new SQLiteConnection(DbPath); - public static TableQuery Sessions => Connection.Table(); - public static TableQuery Folders => Connection.Table(); - public static TableQuery DeletedFolders => Connection.Table(); - public static TableQuery Installations => Connection.Table(); - public static TableQuery DeletedInstallations => Connection.Table(); - public static TableQuery Users => Connection.Table(); - public static TableQuery DeletedUsers => Connection.Table(); - public static TableQuery FolderAccess => Connection.Table(); - public static TableQuery InstallationAccess => Connection.Table(); - public static TableQuery OrderNumber2Installation => Connection.Table(); - + public static TableQuery Sessions => Connection.Table(); + public static TableQuery Folders => Connection.Table(); + public static TableQuery Installations => Connection.Table(); + public static TableQuery Users => Connection.Table(); + public static TableQuery FolderAccess => Connection.Table(); + public static TableQuery InstallationAccess => Connection.Table(); + public static TableQuery OrderNumber2Installation => Connection.Table(); + + public static TableQuery DeletedInstallations => Connection.Table(); + public static TableQuery DeletedUsers => Connection.Table(); + public static TableQuery DeletedFolders => Connection.Table(); public static void Init() { + // used to force static constructor } @@ -54,6 +55,7 @@ public static partial class Db Observable.Interval(TimeSpan.FromDays(0.5)) .StartWith(0) // Do it right away (on startup) .ObserveOn(TaskPoolScheduler.Default) + .SubscribeOn(TaskPoolScheduler.Default) .SelectMany(Cleanup) .Subscribe(); }