From 580db3c63d47956e0b1dd864aed62b32797eef42 Mon Sep 17 00:00:00 2001 From: gioelecerati Date: Wed, 3 Apr 2024 10:21:43 +0200 Subject: [PATCH] tester: delete asset on completion --- internal/app/recordtester/recordtester_app.go | 3 +++ internal/app/vodtester/vodtester_app.go | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/internal/app/recordtester/recordtester_app.go b/internal/app/recordtester/recordtester_app.go index fc3147f4..356bb394 100644 --- a/internal/app/recordtester/recordtester_app.go +++ b/internal/app/recordtester/recordtester_app.go @@ -363,10 +363,13 @@ func (rt *recordTester) Start(fileName string, testDuration, pauseDuration time. if code, err := checkPlaybackInfo(assets[0].PlaybackID, rt.lapi, lapiNoAPIKey); err != nil { return code, err } + + rt.lapi.DeleteAsset(assets[0].ID) } glog.Infof("Done Record Test. streamId=%s playbackId=%s", stream.ID, stream.PlaybackID) rt.lapi.DeleteStream(stream.ID) + return 0, nil } diff --git a/internal/app/vodtester/vodtester_app.go b/internal/app/vodtester/vodtester_app.go index 3c8cf74c..a9739d5d 100644 --- a/internal/app/vodtester/vodtester_app.go +++ b/internal/app/vodtester/vodtester_app.go @@ -77,6 +77,8 @@ func (vt *vodTester) Start(fileName string, vodImportUrl string, taskPollDuratio return fmt.Errorf("error in export task taskId=%s: %w", exportTask.ID, err) } + vt.Lapi.DeleteAsset(importAsset.ID) + return nil }) @@ -194,6 +196,8 @@ func (vt *vodTester) directUploadTester(fileName string, taskPollDuration time.D return fmt.Errorf("error checking playback: %w", err) } + vt.Lapi.DeleteAsset(uploadAsset.ID) + return nil } @@ -248,6 +252,8 @@ func (vt *vodTester) resumableUploadTester(fileName string, taskPollDuration tim return fmt.Errorf("error checking playback: %w", err) } + vt.Lapi.DeleteAsset(uploadAsset.ID) + return nil }