Merge pull request #4326 from crobibero/purge-activity-log

Automatically clean activity log database
This commit is contained in:
Bond-009
2020-11-02 16:52:49 +01:00
committed by GitHub
5 changed files with 105 additions and 0 deletions

View File

@@ -16,5 +16,12 @@ namespace MediaBrowser.Model.Activity
Task CreateAsync(ActivityLog entry);
Task<QueryResult<ActivityLogEntry>> GetPagedResultAsync(ActivityLogQuery query);
/// <summary>
/// Remove all activity logs before the specified date.
/// </summary>
/// <param name="startDate">Activity log start date.</param>
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
Task CleanAsync(DateTime startDate);
}
}

View File

@@ -271,6 +271,11 @@ namespace MediaBrowser.Model.Configuration
/// </summary>
public string[] KnownProxies { get; set; }
/// <summary>
/// Gets or sets the number of days we should retain activity logs.
/// </summary>
public int? ActivityLogRetentionDays { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="ServerConfiguration" /> class.
/// </summary>
@@ -381,6 +386,7 @@ namespace MediaBrowser.Model.Configuration
SlowResponseThresholdMs = 500;
CorsHosts = new[] { "*" };
KnownProxies = Array.Empty<string>();
ActivityLogRetentionDays = 30;
}
}