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.
24 lines
873 B
24 lines
873 B
using ErsatzTV.Core.Health; |
|
using ErsatzTV.Core.Health.Checks; |
|
using ErsatzTV.Core.Interfaces.Database; |
|
|
|
namespace ErsatzTV.Infrastructure.Health.Checks; |
|
|
|
public class DowngradeHealthCheck(IDatabaseMigrations databaseMigrations) : BaseHealthCheck, IDowngradeHealthCheck |
|
{ |
|
public override string Title => "ErsatzTV Downgrade"; |
|
|
|
public async Task<HealthCheckResult> Check(CancellationToken cancellationToken) |
|
{ |
|
IReadOnlyList<string> unknownMigrations = await databaseMigrations.GetUnknownMigrations(); |
|
if (unknownMigrations.Any()) |
|
{ |
|
return FailResult( |
|
"Downgrade detected; THIS IS NOT SUPPORTED AND WILL IMPACT STABILITY", |
|
"Downgrade detected", |
|
new HealthCheckLink("https://ersatztv.org/docs/installation/#downgrading")); |
|
} |
|
|
|
return NotApplicableResult(); |
|
} |
|
}
|
|
|