Skip to content

Commit

Permalink
allow versions of hg container and api to not match in develop enviro…
Browse files Browse the repository at this point in the history
…nment
  • Loading branch information
hahn-kev committed May 23, 2024
1 parent 6002304 commit 899e635
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions .idea/.idea.LexBox/.idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions backend/LexBoxApi/Services/HgWebHealthCheck.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using LexCore.ServiceInterfaces;
using LexCore.Config;
using LexCore.ServiceInterfaces;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.Extensions.Options;

namespace LexBoxApi.Services;

public class HgWebHealthCheck(IHgService hgService) : IHealthCheck
public class HgWebHealthCheck(IHgService hgService, IOptions<HgConfig> hgOptions) : IHealthCheck
{
public async Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context,
CancellationToken cancellationToken = new())
Expand All @@ -13,7 +15,7 @@ public async Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context
{
return HealthCheckResult.Unhealthy();
}
if (version != AppVersionService.Version)
if (hgOptions.Value.RequireContainerVersionMatch && version != AppVersionService.Version)
{
return HealthCheckResult.Degraded(
$"api version: '{AppVersionService.Version}' hg version: '{version}' mismatch");
Expand Down
1 change: 1 addition & 0 deletions backend/LexCore/Config/HgConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ public class HgConfig
[Required, Url]
public required string HgResumableUrl { get; init; }
public bool AutoUpdateLexEntryCountOnSendReceive { get; init; } = false;
public bool RequireContainerVersionMatch { get; init; } = true;
}
2 changes: 2 additions & 0 deletions deployment/develop/lexbox-deployment.patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ spec:
value: "Language Depot (Develop) <[email protected]>"
- name: Email__BaseUrl
value: "https://develop.lexbox.org"
- name: HgConfig__RequireContainerVersionMatch
value: "false"

0 comments on commit 899e635

Please sign in to comment.