Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete: fix list files #236

Merged
merged 1 commit into from
May 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions task/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@

func (r *runner) CronJobForAssetDeletion(ctx context.Context) error {
// Loop every hour to delete assets
ticker := time.NewTicker(10 * time.Minute)
ticker := time.NewTicker(1 * time.Hour)

Check warning on line 580 in task/runner.go

View check run for this annotation

Codecov / codecov/patch

task/runner.go#L580

Added line #L580 was not covered by tests
defer ticker.Stop()

glog.Infof("Starting asset deletion cron job")
Expand Down Expand Up @@ -619,11 +619,13 @@
return err
}

directory := asset.PlaybackID
directory := fmt.Sprintf("%s/", asset.PlaybackID)

Check warning on line 622 in task/runner.go

View check run for this annotation

Codecov / codecov/patch

task/runner.go#L622

Added line #L622 was not covered by tests
var totalDeleted int

glog.Infof("Listing files in directory %v", directory)

Check warning on line 625 in task/runner.go

View check run for this annotation

Codecov / codecov/patch

task/runner.go#L625

Added line #L625 was not covered by tests

// Initially list files
pi, err := assetOS.ListFiles(ctx, directory, "/")
pi, err := assetOS.ListFiles(ctx, directory, "")

Check warning on line 628 in task/runner.go

View check run for this annotation

Codecov / codecov/patch

task/runner.go#L628

Added line #L628 was not covered by tests
glog.Infof("Found %v files for asset %v", len(pi.Files()), asset.ID)
if err != nil {
glog.Errorf("Error listing files for asset %v: %v", asset.ID, err)
Expand Down
Loading