This commit is contained in:
parent
af1710c3fe
commit
c5013c03ff
2 changed files with 14 additions and 0 deletions
10
internal/processor/helper.go
Normal file
10
internal/processor/helper.go
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
package processor
|
||||
|
||||
import "strings"
|
||||
|
||||
func linkIsValid(link string) bool {
|
||||
if strings.HasPrefix(link, "http://") || strings.HasPrefix(link, "https://") {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
|
@ -112,6 +112,10 @@ func (s *service) SendResults(ctx context.Context, chanLen uint) error {
|
|||
func (s *service) sendTasks(tasks []structs.Task) error {
|
||||
for _, tsk := range tasks {
|
||||
for origin, link := range tsk.Origins {
|
||||
if !linkIsValid(link) {
|
||||
continue
|
||||
}
|
||||
|
||||
if origin == "surugaya" {
|
||||
pushTask(s.taskPublishers["surugaya"], tsk.MerchUuid, link)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue