Skip to content

Commit

Permalink
do not fetch the asset again
Browse files Browse the repository at this point in the history
  • Loading branch information
gioelecerati committed Apr 29, 2024
1 parent 60afca3 commit fb5f49d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion task/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,17 @@ func (r *runner) CronJobForAssetDeletion(ctx context.Context) error {
}

func deleteAsset(asset *api.Asset, r *runner, ctx context.Context) error {

Check warning on line 595 in task/runner.go

View check run for this annotation

Codecov / codecov/patch

task/runner.go#L595

Added line #L595 was not covered by tests
_, _, assetOS, err := r.getAssetAndOS(asset.ID)

objectStore, err := r.lapi.GetObjectStore(asset.ObjectStoreID)
if err != nil {
return err

Check warning on line 599 in task/runner.go

View check run for this annotation

Codecov / codecov/patch

task/runner.go#L597-L599

Added lines #L597 - L599 were not covered by tests
}
osDriver, err := drivers.ParseOSURL(objectStore.URL, true)
if err != nil {
return UnretriableError{fmt.Errorf("error parsing object store url=%s: %w", objectStore.URL, err)}

Check warning on line 603 in task/runner.go

View check run for this annotation

Codecov / codecov/patch

task/runner.go#L601-L603

Added lines #L601 - L603 were not covered by tests
}
assetOS := osDriver.NewSession("")

Check warning on line 605 in task/runner.go

View check run for this annotation

Codecov / codecov/patch

task/runner.go#L605

Added line #L605 was not covered by tests

if err != nil {
glog.Errorf("Error getting asset object store session: %v", err)
return err

Check warning on line 609 in task/runner.go

View check run for this annotation

Codecov / codecov/patch

task/runner.go#L607-L609

Added lines #L607 - L609 were not covered by tests
Expand Down

0 comments on commit fb5f49d

Please sign in to comment.