From b03a4b85c97ae1b98b0720913789e7f1b4ee2fd5 Mon Sep 17 00:00:00 2001 From: Josh Patra Date: Mon, 9 Feb 2026 12:24:48 -0500 Subject: [PATCH] fix: cache cleanup service using wrong path - Update CacheCleanupService to use downloads/cache instead of /tmp/allstarr-cache - Matches the actual path used by download services - Fixes cache files not being cleaned up after expiration --- allstarr/Services/Common/CacheCleanupService.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/allstarr/Services/Common/CacheCleanupService.cs b/allstarr/Services/Common/CacheCleanupService.cs index 662e1a0..0676009 100644 --- a/allstarr/Services/Common/CacheCleanupService.cs +++ b/allstarr/Services/Common/CacheCleanupService.cs @@ -66,7 +66,9 @@ public class CacheCleanupService : BackgroundService private async Task CleanupOldCachedFilesAsync(CancellationToken cancellationToken) { - var cachePath = PathHelper.GetCachePath(); + // Get the actual cache path used by download services + var downloadPath = _configuration["DOWNLOAD_PATH"] ?? "downloads"; + var cachePath = Path.Combine(downloadPath, "cache"); if (!Directory.Exists(cachePath)) { @@ -78,7 +80,7 @@ public class CacheCleanupService : BackgroundService var deletedCount = 0; var totalSize = 0L; - _logger.LogInformation("Starting cache cleanup: deleting files older than {CutoffTime}", cutoffTime); + _logger.LogInformation("Starting cache cleanup: deleting files older than {CutoffTime} from {Path}", cutoffTime, cachePath); try {