Keep track of import errors

parent bd9e5c5d
...@@ -50,6 +50,7 @@ module Github ...@@ -50,6 +50,7 @@ module Github
fetch_issues fetch_issues
fetch_wiki_repository fetch_wiki_repository
expire_repository_cache expire_repository_cache
track_errors
errors errors
end end
...@@ -369,6 +370,15 @@ module Github ...@@ -369,6 +370,15 @@ module Github
repository.expire_content_cache repository.expire_content_cache
end 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) def error(type, url, message)
errors << { type: type, url: Gitlab::UrlSanitizer.sanitize(url), error: message } errors << { type: type, url: Gitlab::UrlSanitizer.sanitize(url), error: message }
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