Browse Source

#1943 Able to config fsck timeout

for-closed-social
Unknwon 9 years ago
parent
commit
718d3ae258
7 changed files with 8 additions and 8 deletions
  1. +1
    -1
      README.md
  2. +1
    -0
      conf/app.ini
  3. +1
    -1
      gogs.go
  4. +1
    -3
      models/repo.go
  5. +2
    -2
      modules/bindata/bindata.go
  6. +1
    -0
      modules/setting/setting.go
  7. +1
    -1
      templates/.VERSION

+ 1
- 1
README.md View File

@ -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 View File

@ -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 View File

@ -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 View File

@ -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 {

+ 2
- 2
modules/bindata/bindata.go
File diff suppressed because it is too large
View File


+ 1
- 0
modules/setting/setting.go View File

@ -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 View File

@ -1 +1 @@
0.7.35.1209 Beta
0.7.36.1209 Beta

Loading…
Cancel
Save