mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-02-09 23:55:10 -05:00
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:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user