]> source.dussan.org Git - gitea.git/commitdiff
fix #805
authorUnknwon <joe2010xtmf@163.com>
Fri, 2 Jan 2015 05:30:45 +0000 (13:30 +0800)
committerUnknwon <joe2010xtmf@163.com>
Fri, 2 Jan 2015 05:30:45 +0000 (13:30 +0800)
README.md
README_ZH.md
gogs.go
models/repo.go
templates/.VERSION

index 612f5172d49e5994a6591ec3547177bec50aeb88..ce53a85e82304431fe541c6415ccebf90b5d3e6d 100644 (file)
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@ Gogs(Go Git Service) is a painless self-hosted Git Service written in Go.
 
 ![Demo](https://gowalker.org/public/gogs_demo.gif)
 
-##### Current version: 0.5.9 Beta
+##### Current version: 0.5.11 Beta
 
 ### NOTICES
 
index 643d54a7889091c13721ff9bc3a517e312d8888a..a91b0ce57c8a695c22bc8218201aab1dfd22ec4c 100644 (file)
@@ -5,7 +5,7 @@ Gogs(Go Git Service) 是一个基于 Go 语言的自助 Git 服务。
 
 ![Demo](https://gowalker.org/public/gogs_demo.gif)
 
-##### 当前版本:0.5.9 Beta
+##### 当前版本:0.5.11 Beta
 
 ## 开发目的
 
diff --git a/gogs.go b/gogs.go
index 0deb4585854e6be0aac125bd05f4d1c878c7714b..abb4da4a9e3897b28726d2c9a6058a6e101ba24e 100644 (file)
--- a/gogs.go
+++ b/gogs.go
@@ -17,7 +17,7 @@ import (
        "github.com/gogits/gogs/modules/setting"
 )
 
-const APP_VER = "0.5.10.0102 Beta"
+const APP_VER = "0.5.11.0102 Beta"
 
 func init() {
        runtime.GOMAXPROCS(runtime.NumCPU())
index 925f199483430a992eebb9cf2770d6c8446fdfbf..77c4b140db8a9aa7326514926a420b815dbc4b1d 100644 (file)
@@ -1186,6 +1186,8 @@ func MirrorUpdate() {
        isMirrorUpdating = true
        defer func() { isMirrorUpdating = false }()
 
+       mirrors := make([]*Mirror, 0, 10)
+
        if err := x.Iterate(new(Mirror), func(idx int, bean interface{}) error {
                m := bean.(*Mirror)
                if m.NextUpdate.After(time.Now()) {
@@ -1196,13 +1198,25 @@ func MirrorUpdate() {
                if _, stderr, err := process.ExecDir(10*time.Minute,
                        repoPath, fmt.Sprintf("MirrorUpdate: %s", repoPath),
                        "git", "remote", "update"); err != nil {
-                       return errors.New("git remote update: " + stderr)
+                       desc := fmt.Sprintf("Fail to update mirror repository(%s): %s", repoPath, stderr)
+                       log.Error(4, desc)
+                       if err = CreateRepositoryNotice(desc); err != nil {
+                               log.Error(4, "Fail to add notice: %v", err)
+                       }
+                       return nil
                }
 
                m.NextUpdate = time.Now().Add(time.Duration(m.Interval) * time.Hour)
-               return UpdateMirror(m)
+               mirrors = append(mirrors, m)
+               return nil
        }); err != nil {
-               log.Error(4, "repo.MirrorUpdate: %v", err)
+               log.Error(4, "MirrorUpdate: %v", err)
+       }
+
+       for i := range mirrors {
+               if err := UpdateMirror(mirrors[i]); err != nil {
+                       log.Error(4, "UpdateMirror", fmt.Sprintf("%s: %v", mirrors[i].RepoName, err))
+               }
        }
 }
 
index 2c20d8b2af4bf0cf91101344dbea5a6d7cee4faf..8d89a54a1891fd85dfe8036bd9172ab889d74dae 100644 (file)
@@ -1 +1 @@
-0.5.10.0102 Beta
\ No newline at end of file
+0.5.11.0102 Beta
\ No newline at end of file