diff options
author | Toon Claes <toon@gitlab.com> | 2018-04-24 14:38:08 +0200 |
---|---|---|
committer | Toon Claes <toon@gitlab.com> | 2018-05-07 09:42:09 +0200 |
commit | 5141984747eea59a77cfdf330781e2eeabcd582e (patch) | |
tree | 9b3d3ac45bda6381cd96407d3088bc4b527f6b59 /app/workers | |
parent | d769c43396d0f6318d77aa344ca13e2720c134b1 (diff) | |
download | gitlab-ce-5141984747eea59a77cfdf330781e2eeabcd582e.tar.gz |
Make it easier to override how to save the results
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/repository_check/single_repository_worker.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/app/workers/repository_check/single_repository_worker.rb b/app/workers/repository_check/single_repository_worker.rb index 34b56fc6092..9a4fe902f0b 100644 --- a/app/workers/repository_check/single_repository_worker.rb +++ b/app/workers/repository_check/single_repository_worker.rb @@ -5,14 +5,19 @@ module RepositoryCheck def perform(project_id) project = Project.find(project_id) + + save_result(project, !check) + end + + private + + def save_result(project, failure) project.update_columns( - last_repository_check_failed: !check(project), + last_repository_check_failed: failure, last_repository_check_at: Time.now ) end - private - def check(project) check_repo(project) && check_wiki_repo(project) end |