From 5b3f9269e7a4c709d5ced93c0f13492a3189c4f6 Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Wed, 20 May 2026 20:34:49 -0400 Subject: cli: job command --- lulu.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lulu.go') diff --git a/lulu.go b/lulu.go index 643b65d..212a895 100644 --- a/lulu.go +++ b/lulu.go @@ -86,7 +86,7 @@ func (c *Client) ValidateInterior(ctx context.Context, srcUrl string, mfg PkgId) if err != nil { return InteriorValidation{}, err } - return c.pollInteriorValidation(ctx, id) + return c.pollInteriorValidation(ctx, id, InteriorStatusNormalized) } // ValidateInteriorBasic is like ValidateInterior but without the @@ -96,13 +96,15 @@ func (c *Client) ValidateInteriorBasic(ctx context.Context, srcUrl string) (Inte if err != nil { return InteriorValidation{}, err } - return c.pollInteriorValidation(ctx, id) + return c.pollInteriorValidation(ctx, id, InteriorStatusValidated) } -func (c *Client) pollInteriorValidation(ctx context.Context, id uint) (InteriorValidation, error) { +func (c *Client) pollInteriorValidation(ctx context.Context, id uint, wantStatus InteriorValidationStatus) (InteriorValidation, error) { return poll(ctx, func() (InteriorValidation, bool, error) { val, err := c.GetInteriorValidation(id) - return val, val.Status.IsFinal(), err + done := val.Status == wantStatus || + val.Status == InteriorStatusError + return val, done, err }) } -- cgit v1.2.3