Subscribe Cleanup on TaskPoolScheduler, should make Backend startup faster
This commit is contained in:
parent
a6252895bb
commit
005da7fbcb
|
@ -16,20 +16,21 @@ public static partial class Db
|
|||
|
||||
private static SQLiteConnection Connection { get; } = new SQLiteConnection(DbPath);
|
||||
|
||||
public static TableQuery<Session> Sessions => Connection.Table<Session>();
|
||||
public static TableQuery<Folder> Folders => Connection.Table<Folder>();
|
||||
public static TableQuery<DeletedFolder> DeletedFolders => Connection.Table<DeletedFolder>();
|
||||
public static TableQuery<Installation> Installations => Connection.Table<Installation>();
|
||||
public static TableQuery<DeletedInstallation> DeletedInstallations => Connection.Table<DeletedInstallation>();
|
||||
public static TableQuery<User> Users => Connection.Table<User>();
|
||||
public static TableQuery<DeletedUser> DeletedUsers => Connection.Table<DeletedUser>();
|
||||
public static TableQuery<FolderAccess> FolderAccess => Connection.Table<FolderAccess>();
|
||||
public static TableQuery<InstallationAccess> InstallationAccess => Connection.Table<InstallationAccess>();
|
||||
public static TableQuery<OrderNumber2Installation> OrderNumber2Installation => Connection.Table<OrderNumber2Installation>();
|
||||
|
||||
public static TableQuery<Session> Sessions => Connection.Table<Session>();
|
||||
public static TableQuery<Folder> Folders => Connection.Table<Folder>();
|
||||
public static TableQuery<Installation> Installations => Connection.Table<Installation>();
|
||||
public static TableQuery<User> Users => Connection.Table<User>();
|
||||
public static TableQuery<FolderAccess> FolderAccess => Connection.Table<FolderAccess>();
|
||||
public static TableQuery<InstallationAccess> InstallationAccess => Connection.Table<InstallationAccess>();
|
||||
public static TableQuery<OrderNumber2Installation> OrderNumber2Installation => Connection.Table<OrderNumber2Installation>();
|
||||
|
||||
public static TableQuery<DeletedInstallation> DeletedInstallations => Connection.Table<DeletedInstallation>();
|
||||
public static TableQuery<DeletedUser> DeletedUsers => Connection.Table<DeletedUser>();
|
||||
public static TableQuery<DeletedFolder> DeletedFolders => Connection.Table<DeletedFolder>();
|
||||
|
||||
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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue