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
This commit is contained in:
2026-02-09 12:24:48 -05:00
parent 565cb46b72
commit b03a4b85c9

View File

@@ -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
{