Bläddra i källkod

#1943 Able to config fsck timeout

Unknwon 9 år sedan
förälder
incheckning
718d3ae258
7 ändrade filer med 6 tillägg och 6 borttagningar
  1. 1 1
      README.md
  2. 1 0
      conf/app.ini
  3. 1 1
      gogs.go
  4. 1 3
      models/repo.go
  5. 0 0
      modules/bindata/bindata.go
  6. 1 0
      modules/setting/setting.go
  7. 1 1
      templates/.VERSION

+ 1 - 1
README.md

@@ -5,7 +5,7 @@ Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?bra
 
 ![](public/img/gogs-large-resize.png)
 
-##### Current version: 0.7.35 Beta
+##### Current version: 0.7.36 Beta
 
 | Web | UI  | Preview  |
 |:-------------:|:-------:|:-------:|

+ 1 - 0
conf/app.ini

@@ -296,6 +296,7 @@ SCHEDULE = @every 1h
 ; Repository health check
 [cron.repo_health_check]
 SCHEDULE = @every 24h
+TIMEOUT = 60s
 ; Arguments for command 'git fsck', e.g.: "--unreachable --tags"
 ; see more on http://git-scm.com/docs/git-fsck/1.7.5
 ARGS = 

+ 1 - 1
gogs.go

@@ -17,7 +17,7 @@ import (
 	"github.com/gogits/gogs/modules/setting"
 )
 
-const APP_VER = "0.7.35.1209 Beta"
+const APP_VER = "0.7.36.1209 Beta"
 
 func init() {
 	runtime.GOMAXPROCS(runtime.NumCPU())

+ 1 - 3
models/repo.go

@@ -1583,13 +1583,11 @@ func GitFsck() {
 
 	log.Trace("Doing: GitFsck")
 
-	args := append([]string{"fsck"}, setting.Cron.RepoHealthCheck.Args...)
 	if err := x.Where("id>0").Iterate(new(Repository),
 		func(idx int, bean interface{}) error {
 			repo := bean.(*Repository)
 			repoPath := repo.RepoPath()
-			_, _, err := process.ExecDir(-1, repoPath, "Repository health check", "git", args...)
-			if err != nil {
+			if err := git.Fsck(repoPath, setting.Cron.RepoHealthCheck.Timeout, setting.Cron.RepoHealthCheck.Args...); err != nil {
 				desc := fmt.Sprintf("Fail to health check repository(%s)", repoPath)
 				log.Warn(desc)
 				if err = CreateRepositoryNotice(desc); err != nil {

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
modules/bindata/bindata.go


+ 1 - 0
modules/setting/setting.go

@@ -162,6 +162,7 @@ var (
 			Enabled    bool
 			RunAtStart bool
 			Schedule   string
+			Timeout    time.Duration
 			Args       []string `delim:" "`
 		} `ini:"cron.repo_health_check"`
 		CheckRepoStats struct {

+ 1 - 1
templates/.VERSION

@@ -1 +1 @@
-0.7.35.1209 Beta
+0.7.36.1209 Beta

Vissa filer visades inte eftersom för många filer har ändrats