Fix 9.4e: the four readers use the branch follower's Entry, Ready, entries rows, entry-not-found finding and entry_again tool; their copies are deleted
Builds: design 47 G A-103, A-15, §614 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
@@ -6,10 +6,6 @@ package main
|
||||
// `manifests`.
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"git.novox.be/novox/mesh-delivery/contracts/go/clients/meshcatalogclient"
|
||||
catalog "git.novox.be/novox/mesh-delivery/contracts/go/seats/meshcatalog"
|
||||
)
|
||||
|
||||
@@ -20,41 +16,3 @@ type CatalogHalf interface {
|
||||
// Ready is nil once every watched branch has its first view (none-yet counting as one), else says what it waits for.
|
||||
Ready() error
|
||||
}
|
||||
|
||||
// branchesHalf is the CatalogHalf over the follower of the watched branches.
|
||||
type branchesHalf struct{ b *meshcatalogclient.Branches }
|
||||
|
||||
func (h branchesHalf) Ready() error {
|
||||
followed := h.b.Followed()
|
||||
if len(followed) == 0 {
|
||||
return fmt.Errorf("the catalog half names no watched branch yet (the seat mesh-catalog's registrations are asked until they answer)")
|
||||
}
|
||||
var waiting []string
|
||||
for _, branch := range followed {
|
||||
if c, ok := h.b.Catalog(branch); ok {
|
||||
select {
|
||||
case <-c.Ready():
|
||||
default:
|
||||
waiting = append(waiting, branch)
|
||||
}
|
||||
}
|
||||
}
|
||||
if len(waiting) > 0 {
|
||||
return fmt.Errorf("the catalog half has no first view of %s yet", strings.Join(waiting, ", "))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (h branchesHalf) Entry(module string) (catalog.CatalogEntry, bool, error) {
|
||||
if err := h.Ready(); err != nil {
|
||||
return catalog.CatalogEntry{}, false, err
|
||||
}
|
||||
for _, branch := range h.b.Followed() { // the branch followed first names a module more than one hold
|
||||
if c, ok := h.b.Catalog(branch); ok {
|
||||
if e, ok := c.Entry(module); ok {
|
||||
return e, true, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
return catalog.CatalogEntry{}, false, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user