mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Delete favicons that are older than 10 days
This commit is contained in:
parent
843396f7c4
commit
49eb75c5dc
@ -89,6 +89,18 @@ namespace Wabbajack
|
||||
Consts.FaviconCacheFolderPath.CreateDirectory();
|
||||
|
||||
var faviconIcon = Consts.FaviconCacheFolderPath.Combine($"{Login.SiteName}.ico");
|
||||
if (faviconIcon.Exists)
|
||||
{
|
||||
var fsi = new FileInfo(faviconIcon.ToString());
|
||||
var creationDate = fsi.CreationTimeUtc;
|
||||
var now = DateTime.UtcNow;
|
||||
|
||||
//delete favicons older than 10 days
|
||||
|
||||
if ((now - creationDate).TotalDays > 10)
|
||||
await faviconIcon.DeleteAsync();
|
||||
}
|
||||
|
||||
if (faviconIcon.Exists)
|
||||
{
|
||||
await using var fs = await faviconIcon.OpenRead();
|
||||
|
Loading…
Reference in New Issue
Block a user