aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Events/EventService.cs
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2024-09-15 17:47:04 -0500
committerJP Dillingham <jp@dillingham.me>2024-09-15 17:47:04 -0500
commit1eb7649c460518bbedae2bc25fae120b9faf8157 (patch)
tree6db4cc7c29f10f68dd84d9c66b161b1e16c272a6 /src/slskd/Events/EventService.cs
parent7f77d6e9c67e5f3c8166e4696b0b5751dd9d7055 (diff)
downloadslskd-1eb7649c460518bbedae2bc25fae120b9faf8157.tar.gz
don't prune events (yet?)
Diffstat (limited to 'src/slskd/Events/EventService.cs')
-rw-r--r--src/slskd/Events/EventService.cs29
1 files changed, 0 insertions, 29 deletions
diff --git a/src/slskd/Events/EventService.cs b/src/slskd/Events/EventService.cs
index 188d5895..85f82238 100644
--- a/src/slskd/Events/EventService.cs
+++ b/src/slskd/Events/EventService.cs
@@ -66,33 +66,4 @@ public class EventService
throw;
}
}
-
- /// <summary>
- /// Removes event records older than the specified <paramref name="ageInDays"/>.
- /// </summary>
- /// <param name="ageInDays">The age after which event records are eligible for pruning, in days.</param>
- /// <returns>The number of pruned event records.</returns>
- public virtual int Prune(int ageInDays)
- {
- try
- {
- using var context = ContextFactory.CreateDbContext();
-
- var cutoffDateTime = DateTime.UtcNow.AddDays(-ageInDays);
-
- var pruned = context.Events.Where(e => e.Timestamp < cutoffDateTime).ExecuteDelete();
-
- if (pruned > 0)
- {
- Log.Debug("Pruned {Count} expired events", pruned);
- }
-
- return pruned;
- }
- catch (Exception ex)
- {
- Log.Error(ex, "Failed to prune events: {Message}", ex.Message);
- throw;
- }
- }
} \ No newline at end of file