Keep track of import errors

This commit is contained in:
Douglas Barbosa Alexandre 2017-04-19 22:01:37 -03:00
parent bd9e5c5ddf
commit 09a6d32817
1 changed files with 10 additions and 0 deletions

View File

@ -50,6 +50,7 @@ module Github
fetch_issues
fetch_wiki_repository
expire_repository_cache
track_errors
errors
end
@ -369,6 +370,15 @@ module Github
repository.expire_content_cache
end
def track_errors
return unless errors.any?
project.update_column(:import_error, {
message: 'The remote data could not be fully imported.',
errors: errors
}.to_json)
end
def error(type, url, message)
errors << { type: type, url: Gitlab::UrlSanitizer.sanitize(url), error: message }
end