mirror of https://github.com/ErsatzTV/ErsatzTV.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.1 KiB
34 lines
1.1 KiB
using ErsatzTV.Core.Domain; |
|
using ErsatzTV.Core.Health; |
|
using ErsatzTV.Core.Health.Checks; |
|
using ErsatzTV.Core.Interfaces.Repositories; |
|
|
|
namespace ErsatzTV.Infrastructure.Health.Checks; |
|
|
|
public class FFmpegReportsHealthCheck : BaseHealthCheck, IFFmpegReportsHealthCheck |
|
{ |
|
private readonly IConfigElementRepository _configElementRepository; |
|
|
|
public FFmpegReportsHealthCheck(IConfigElementRepository configElementRepository) => |
|
_configElementRepository = configElementRepository; |
|
|
|
public override string Title => "FFmpeg Reports"; |
|
|
|
public async Task<HealthCheckResult> Check(CancellationToken cancellationToken) |
|
{ |
|
Option<bool> saveReports = |
|
await _configElementRepository.GetValue<bool>(ConfigElementKey.FFmpegSaveReports); |
|
|
|
foreach (bool value in saveReports) |
|
{ |
|
if (value) |
|
{ |
|
return Result( |
|
HealthCheckStatus.Warning, |
|
"FFmpeg troubleshooting reports are enabled and may use a lot of disk space"); |
|
} |
|
} |
|
|
|
return OkResult(); |
|
} |
|
}
|
|
|