@@ 23,7 23,7 @@ func Fetch(phan1, phan2 string, timeout
resultB := make(chan *Result, 2)
phanTimeout := "300"
if page.Attempts() > 1 {
- phanTimeout = "5000"
+ phanTimeout = fmt.Sprintf("%d", (page.Attempts()+1) * 5000)
}
if page.OriginImage() == "" {
go fetchPage(phan1, phanTimeout, page.OriginURL(), resultA)
@@ 31,7 31,7 @@ func Fetch(phan1, phan2 string, timeout
if page.CopyImage() == "" {
go fetchPage(phan2, phanTimeout, page.CopyURL(), resultB)
}
- timer := time.AfterFunc(time.Duration(timeout)*time.Second, func() {
+ timer := time.AfterFunc(time.Duration(timeout * int64(page.Attempts()+1))*time.Second, func() {
resultA <- nil
resultB <- nil
})