From c3a52f7dd075f1f3cf7fb935b7489629760837ab Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 15 Apr 2014 20:01:20 -0400 Subject: Mirror bug fix on downloading zip --- modules/avatar/avatar.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'modules/avatar/avatar.go') diff --git a/modules/avatar/avatar.go b/modules/avatar/avatar.go index edeb256ffe..5ed5d16a62 100644 --- a/modules/avatar/avatar.go +++ b/modules/avatar/avatar.go @@ -157,9 +157,9 @@ func (this *service) ServeHTTP(w http.ResponseWriter, r *http.Request) { avatar := New(hash, this.cacheDir) avatar.AlterImage = this.altImage if avatar.Expired() { - err := avatar.UpdateTimeout(time.Millisecond * 500) - if err != nil { + if err := avatar.UpdateTimeout(time.Millisecond * 1000); err != nil { log.Trace("avatar update error: %v", err) + return } } if modtime, err := avatar.Modtime(); err == nil { @@ -250,6 +250,7 @@ func (this *thunderTask) Fetch() { var client = &http.Client{} func (this *thunderTask) fetch() error { + log.Debug("avatar.fetch(fetch new avatar): %s", this.Url) req, _ := http.NewRequest("GET", this.Url, nil) req.Header.Set("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/jpeg,image/png,*/*;q=0.8") req.Header.Set("Accept-Encoding", "deflate,sdch") -- cgit v1.2.3