From 542182c5735b684257dde345c1b94deed11bd22a Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Thu, 9 May 2024 12:56:41 +0700 Subject: [PATCH] Invalidate dir cache in a couple more places --- backend/LexBoxApi/Services/ProjectService.cs | 8 ++++++++ backend/LexCore/ServiceInterfaces/IHgService.cs | 1 + 2 files changed, 9 insertions(+) diff --git a/backend/LexBoxApi/Services/ProjectService.cs b/backend/LexBoxApi/Services/ProjectService.cs index db8a3c0f8..5e351fc38 100644 --- a/backend/LexBoxApi/Services/ProjectService.cs +++ b/backend/LexBoxApi/Services/ProjectService.cs @@ -117,6 +117,10 @@ public async Task FinishReset(string code, Stream? zipFile = null) await hgService.FinishReset(code, zipFile); await UpdateProjectMetadata(project); } + else + { + await hgService.InvalidateDirCache(code); + } project.ResetStatus = ResetStatus.None; project.UpdateUpdatedDate(); await dbContext.SaveChangesAsync(); @@ -146,6 +150,10 @@ public async Task UpdateProjectMetadata(Project project) project.FlexProjectMetadata.LexEntryCount = count; } } + else + { + await hgService.InvalidateDirCache(project.Code); + } project.LastCommit = await hgService.GetLastCommitTimeFromHg(project.Code); // Caller is responsible for caling dbContext.SaveChangesAsync() diff --git a/backend/LexCore/ServiceInterfaces/IHgService.cs b/backend/LexCore/ServiceInterfaces/IHgService.cs index 01309eed9..e010611b8 100644 --- a/backend/LexCore/ServiceInterfaces/IHgService.cs +++ b/backend/LexCore/ServiceInterfaces/IHgService.cs @@ -18,5 +18,6 @@ public interface IHgService Task GetLexEntryCount(string code, ProjectType projectType); Task GetRepositoryIdentifier(Project project); Task ExecuteHgRecover(string code, CancellationToken token); + Task InvalidateDirCache(string code); bool HasAbandonedTransactions(string projectCode); }