A report the store cannot take yet is handed back to the broker, not acknowledged and lost (novox/hq issue 082)
This commit is contained in:
@@ -144,7 +144,14 @@ var ErrNoBrokerManagement = errors.New("no broker management configured")
|
||||
// A node states; the owning context writes (novox/hq ADR 0006). What a node says it applied is
|
||||
// its own account of its own machine, kept as a copy for recovery — so this writes it down and
|
||||
// decides nothing from it.
|
||||
func (e Enrolment) Heard(ctx context.Context, report Report) error {
|
||||
func (e Enrolment) Heard(ctx context.Context, report Report) (err error) {
|
||||
// A store that could not be asked right now is said as such, so the report is kept for
|
||||
// another attempt rather than acknowledged and lost (novox/hq issue 082).
|
||||
defer func() {
|
||||
if inventory.Unreachable(err) {
|
||||
err = fmt.Errorf("%w: %w", ErrTryAgain, err)
|
||||
}
|
||||
}()
|
||||
if report.Node == "" {
|
||||
return errors.New("a report named no node")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user