Give every module of a failed send a verdict, and excuse only the wait a build's own send brought (hq issue 318 review)
This commit is contained in:
@@ -276,6 +276,13 @@ func (k *Keeper) Observe(ctx context.Context, o Observation) (Condition, error)
|
||||
|
||||
// Clear removes a condition an observation says is resolved, and says so. False when none was open.
|
||||
func (k *Keeper) Clear(ctx context.Context, key, why string) (bool, error) {
|
||||
return k.ClearSaying(ctx, key, why, "")
|
||||
}
|
||||
|
||||
// ClearSaying is Clear with the line the operator reads when it clears, in place of the condition's own
|
||||
// resolved line: for a condition that ends because it became another (novox/hq ADR 0254: a module not
|
||||
// working that now waits for a new login is not "working again"). Empty keeps the condition's own.
|
||||
func (k *Keeper) ClearSaying(ctx context.Context, key, why, resolved string) (bool, error) {
|
||||
for i := 0; i < tries; i++ {
|
||||
entry, found, err := k.store.Get(ctx, key)
|
||||
if err != nil {
|
||||
@@ -292,6 +299,9 @@ func (k *Keeper) Clear(ctx context.Context, key, why string) (bool, error) {
|
||||
if err := k.stamp(&c); err != nil {
|
||||
return false, err
|
||||
}
|
||||
if resolved != "" {
|
||||
c.Resolved = resolved
|
||||
}
|
||||
if err := k.store.Delete(ctx, key, entry.Revision); errors.Is(err, ErrMoved) {
|
||||
continue
|
||||
} else if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user