Skip to content

Commit

Permalink
Fix legacy corpora not being removed from ServalData
Browse files Browse the repository at this point in the history
  • Loading branch information
pmachapman committed Dec 15, 2024
1 parent dffb641 commit f66ab50
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/SIL.XForge.Scripture/Services/MachineProjectService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1312,10 +1312,12 @@ CancellationToken cancellationToken
}

// Remove the corpora and files
foreach (
(string corpusId, _) in projectSecret.ServalData?.Corpora?.Where(c => c.Value.PreTranslate == preTranslate)
?? []
)
string[] corpusIds =
projectSecret
.ServalData?.Corpora?.Where(c => c.Value.PreTranslate == preTranslate)
.Select(c => c.Key)
.ToArray() ?? [];
foreach (string corpusId in corpusIds)
{
// Delete the corpus
try
Expand Down

0 comments on commit f66ab50

Please sign in to comment.