Commit 51419847 authored by Toon Claes's avatar Toon Claes

Make it easier to override how to save the results

parent d769c433
...@@ -5,14 +5,19 @@ module RepositoryCheck ...@@ -5,14 +5,19 @@ module RepositoryCheck
def perform(project_id) def perform(project_id)
project = Project.find(project_id) project = Project.find(project_id)
save_result(project, !check)
end
private
def save_result(project, failure)
project.update_columns( project.update_columns(
last_repository_check_failed: !check(project), last_repository_check_failed: failure,
last_repository_check_at: Time.now last_repository_check_at: Time.now
) )
end end
private
def check(project) def check(project)
check_repo(project) && check_wiki_repo(project) check_repo(project) && check_wiki_repo(project)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment