2012-01-15 05:47:23 +03:00
|
|
|
using System;
|
|
|
|
using System.Linq;
|
2013-02-18 10:59:43 +03:00
|
|
|
using NzbDrone.Core.Jobs;
|
2011-11-22 10:35:11 +03:00
|
|
|
using NzbDrone.Core.Model.Notification;
|
|
|
|
|
2013-02-18 10:59:43 +03:00
|
|
|
namespace NzbDrone.Core.Instrumentation
|
2011-11-22 10:35:11 +03:00
|
|
|
{
|
|
|
|
public class TrimLogsJob : IJob
|
|
|
|
{
|
2013-02-23 22:38:25 +03:00
|
|
|
private readonly LogService _logService;
|
2011-11-22 10:35:11 +03:00
|
|
|
|
2013-02-23 22:38:25 +03:00
|
|
|
public TrimLogsJob(LogService logService)
|
2011-11-22 10:35:11 +03:00
|
|
|
{
|
2013-02-23 22:38:25 +03:00
|
|
|
_logService = logService;
|
2011-11-22 10:35:11 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
public string Name
|
|
|
|
{
|
|
|
|
get { return "Trim Logs Job"; }
|
|
|
|
}
|
|
|
|
|
2012-01-15 05:47:23 +03:00
|
|
|
public TimeSpan DefaultInterval
|
2011-11-22 10:35:11 +03:00
|
|
|
{
|
2012-01-15 05:47:23 +03:00
|
|
|
get { return TimeSpan.FromDays(1); }
|
2011-11-22 10:35:11 +03:00
|
|
|
}
|
|
|
|
|
2012-09-10 22:04:17 +03:00
|
|
|
public virtual void Start(ProgressNotification notification, dynamic options)
|
2011-11-22 10:35:11 +03:00
|
|
|
{
|
2013-02-23 22:38:25 +03:00
|
|
|
_logService.Trim();
|
2011-11-22 10:35:11 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|