diff options
author | Unknown <joe2010xtmf@163.com> | 2014-04-15 20:01:20 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-04-15 20:01:20 -0400 |
commit | c3a52f7dd075f1f3cf7fb935b7489629760837ab (patch) | |
tree | ab27cc4a5cc1d10c366bcfd04585f02fccb8176b /modules/avatar | |
parent | 67426534ef9f0ceba49330cbc0b7676f4009a6e1 (diff) | |
download | gitea-c3a52f7dd075f1f3cf7fb935b7489629760837ab.tar.gz gitea-c3a52f7dd075f1f3cf7fb935b7489629760837ab.zip |
Mirror bug fix on downloading zip
Diffstat (limited to 'modules/avatar')
-rw-r--r-- | modules/avatar/avatar.go | 5 |
1 files changed, 3 insertions, 2 deletions
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") |