-
Notifications
You must be signed in to change notification settings - Fork 30
Add update-link-index-all command #963
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few nits, other than that LGTM!
{ | ||
{ NarrativeRepository.RepositoryName, assembleContext.Configuration.Narrative } | ||
}; | ||
await Parallel.ForEachAsync(repositories, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you observe this speeding up the build? Just curious since GenerateAll
also tries to satisfy all threads with concurrent generation.
BucketName = bucketName, | ||
Key = $"elastic/{checkout.Repository.Name}/{checkout.Repository.GetBranch(contentSource)}/links.json", | ||
ContentBody = content, | ||
ContentType = MediaTypeNames.Application.Json, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ChecksumAlgorithm = SHA256
[YamlMember(Alias = "skip")] | ||
public bool Skip { get; set; } | ||
|
||
public string GetBranch(ContentSource contentSource) => contentSource switch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
MaxDegreeOfParallelism = Environment.ProcessorCount | ||
}, async (kv, c) => | ||
{ | ||
var name = kv.Key.Trim(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try/catch
the loop method and emit an error over the diagnostics channel.
That way we can still build all the repositories that do validate and update those.
Co-authored-by: Martijn Laarman <Mpdreamz@gmail.com>
Follow up with refactoring into a separate class e.g. LinkIndexService