Skip to content
This repository has been archived by the owner on Dec 3, 2018. It is now read-only.

do nothing if there are no files to download #26

Merged
merged 1 commit into from
Sep 7, 2016
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
7 changes: 6 additions & 1 deletion sia-ant/job_renter.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (j *JobRunner) storageRenter() {
}
}()

// Every 200 seconds, download a file. Verify that the download call
// Every 200 seconds, attempt to download a file. Verify that the download call
// succeeds correctly, the file is placed in the download list, and the file
// is removed from the download list, indicating successful download
// completion.
Expand All @@ -143,6 +143,11 @@ func (j *JobRunner) storageRenter() {
log.Printf("%v jobStorageRenter ERROR: %v\n", j.siaDirectory, err)
}

// Do nothing if there are not any files to be downloaded.
if len(renterFiles.Files) == 0 {
return
}

// Filter out files which are not available.
availableFiles := renterFiles.Files[:0]
for _, file := range renterFiles.Files {
Expand Down