diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2026-05-20 20:34:49 -0400 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2026-05-20 20:34:49 -0400 |
| commit | 5b3f9269e7a4c709d5ced93c0f13492a3189c4f6 (patch) | |
| tree | 9f356fc520eab81786e7b41f2d560d0b60e9cc75 /lulu.go | |
| parent | 2a4b7f4cd36aadd3448a303e6bcf1a703ad575d8 (diff) | |
| download | lulu-5b3f9269e7a4c709d5ced93c0f13492a3189c4f6.zip | |
cli: job command
Diffstat (limited to 'lulu.go')
| -rw-r--r-- | lulu.go | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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 }) } |