aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Events/EventService.cs
diff options
context:
space:
mode:
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