Integrate ws client into downloader
This commit is contained in:
@@ -30,3 +30,14 @@ func Download(event PBEvent, status chan error) {
|
||||
log.Printf("Downloaded %s (%s)", event.Record.Id, event.Record.Link)
|
||||
SetDownloaded(event)
|
||||
}
|
||||
|
||||
func DownloadURL(url string, status chan error) {
|
||||
log.Printf("Downloading %s", url)
|
||||
_, err := dl.Run(context.TODO(), url)
|
||||
if err != nil {
|
||||
status <- err
|
||||
return
|
||||
}
|
||||
|
||||
log.Printf("Downloaded %s", url)
|
||||
}
|
||||
|
Reference in New Issue
Block a user