Remove DynamicImageResponse local image after saved to metadata folder

Previously, local images provided by DynamicImageResponse were never cleaned up until the server was restarted. This issue has become more severe in 10.10, as the default is now set to use the system's native temp folder, which might be a RAM backed tmpfs. This behavior could lead to resource starvation for long-running servers performing multiple library scans.

Metadata plugins prefer the old behavior should do its own backup.
pull/12940/head
gnattu 4 months ago
parent 3592c629e7
commit 74d2c2addf

@ -232,6 +232,8 @@ namespace MediaBrowser.Providers.Manager
var stream = AsyncFile.OpenRead(response.Path); var stream = AsyncFile.OpenRead(response.Path);
await _providerManager.SaveImage(item, stream, mimeType, imageType, null, cancellationToken).ConfigureAwait(false); await _providerManager.SaveImage(item, stream, mimeType, imageType, null, cancellationToken).ConfigureAwait(false);
File.Delete(response.Path);
} }
} }

Loading…
Cancel
Save