Skip to content

Commit

Permalink
Cleaner indicator cancellation
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmalkmus committed Mar 29, 2021
1 parent 4eebec3 commit 9b88239
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion cmd/axiom/organization/organization_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,13 @@ func runInfo(ctx context.Context, opts *infoOptions) error {
}

progStop := opts.IO.StartActivityIndicator()
defer progStop()

organization, err := client.Organizations.Get(ctx, opts.ID)
if err != nil {
progStop()
return err
}

progStop()

pagerStop, err := opts.IO.StartPager(ctx)
Expand Down
4 changes: 3 additions & 1 deletion cmd/axiom/organization/organization_license.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,13 @@ func runLicense(ctx context.Context, opts *licenseOptions) error {
}

progStop := opts.IO.StartActivityIndicator()
defer progStop()

organization, err := client.Organizations.Get(ctx, opts.ID)
if err != nil {
progStop()
return err
}

progStop()

pagerStop, err := opts.IO.StartPager(ctx)
Expand Down
4 changes: 3 additions & 1 deletion cmd/axiom/organization/organization_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@ func runList(ctx context.Context, opts *listOptions) error {
}

progStop := opts.IO.StartActivityIndicator()
defer progStop()

organizations, err := client.Organizations.List(ctx)
if err != nil {
progStop()
return err
}

progStop()

pagerStop, err := opts.IO.StartPager(ctx)
Expand Down

0 comments on commit 9b88239

Please sign in to comment.