Skip to content

Commit

Permalink
Invalidate dir cache in a couple more places
Browse files Browse the repository at this point in the history
  • Loading branch information
rmunn committed May 9, 2024
1 parent 1df5933 commit 542182c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions backend/LexBoxApi/Services/ProjectService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions backend/LexCore/ServiceInterfaces/IHgService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ public interface IHgService
Task<int?> GetLexEntryCount(string code, ProjectType projectType);
Task<string?> GetRepositoryIdentifier(Project project);
Task<HttpContent> ExecuteHgRecover(string code, CancellationToken token);
Task InvalidateDirCache(string code);
bool HasAbandonedTransactions(string projectCode);
}

0 comments on commit 542182c

Please sign in to comment.