diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2016-06-15 19:11:25 +0200 |
---|---|---|
committer | Jacob Vosmaer <jacob@gitlab.com> | 2016-06-15 19:11:25 +0200 |
commit | d9f6d5dd59281a8efcd6cb7b392b1ef3bafa778d (patch) | |
tree | 155809a6bb6369fd19c8bbdbefc8cfefca9cc2de /app/workers | |
parent | b22473983e8ac1db8556e7b780a18c7c123a64b5 (diff) | |
download | gitlab-ce-d9f6d5dd59281a8efcd6cb7b392b1ef3bafa778d.tar.gz |
Do not check repos without push events
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/repository_check/single_repository_worker.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/workers/repository_check/single_repository_worker.rb b/app/workers/repository_check/single_repository_worker.rb index f2d12ba5a7d..98ddf5d0688 100644 --- a/app/workers/repository_check/single_repository_worker.rb +++ b/app/workers/repository_check/single_repository_worker.rb @@ -15,7 +15,7 @@ module RepositoryCheck private def check(project) - if !git_fsck(project.repository) + if has_pushes?(project) && !git_fsck(project.repository) false elsif project.wiki_enabled? # Historically some projects never had their wiki repos initialized; @@ -44,5 +44,9 @@ module RepositoryCheck false end end + + def has_pushes?(project) + Project.with_push.exists?(project.id) + end end end |