mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
New: Main DB is compressed on app start
This commit is contained in:
@@ -27,7 +27,7 @@ namespace NzbDrone.Core.Datastore
|
||||
void InsertMany(IList<TModel> model);
|
||||
void UpdateMany(IList<TModel> model);
|
||||
void DeleteMany(List<TModel> model);
|
||||
void Purge();
|
||||
void Purge(bool vacuum = false);
|
||||
bool HasItems();
|
||||
void DeleteMany(IEnumerable<int> ids);
|
||||
void SetFields(TModel model, params Expression<Func<TModel, object>>[] properties);
|
||||
@@ -216,9 +216,18 @@ namespace NzbDrone.Core.Datastore
|
||||
}
|
||||
}
|
||||
|
||||
public void Purge()
|
||||
public void Purge(bool vacuum = false)
|
||||
{
|
||||
DataMapper.Delete<TModel>(c => c.Id > -1);
|
||||
if (vacuum)
|
||||
{
|
||||
Vacuum();
|
||||
}
|
||||
}
|
||||
|
||||
protected void Vacuum()
|
||||
{
|
||||
_database.Vacuum();
|
||||
}
|
||||
|
||||
public bool HasItems()
|
||||
@@ -258,11 +267,6 @@ namespace NzbDrone.Core.Datastore
|
||||
.Take(pagingSpec.PageSize);
|
||||
}
|
||||
|
||||
public void DeleteAll()
|
||||
{
|
||||
DataMapper.Delete<TModel>(c => c.Id > 0);
|
||||
}
|
||||
|
||||
protected void ModelCreated(TModel model)
|
||||
{
|
||||
PublishModelEvent(model, ModelAction.Created);
|
||||
|
Reference in New Issue
Block a user