summaryrefslogtreecommitdiff
path: root/lib/github
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2017-04-19 22:01:37 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2017-04-24 16:17:52 -0300
commit09a6d32817f5f4da8ff9f3331a7046670a10beed (patch)
tree407386d68241c549f983a6a2d4513f634656c13a /lib/github
parentbd9e5c5ddf1810da33c65090c16f4e44e087cbcf (diff)
downloadgitlab-ce-09a6d32817f5f4da8ff9f3331a7046670a10beed.tar.gz
Keep track of import errors
Diffstat (limited to 'lib/github')
-rw-r--r--lib/github/import.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/github/import.rb b/lib/github/import.rb
index bf0df041f15..a1854f7f235 100644
--- a/lib/github/import.rb
+++ b/lib/github/import.rb
@@ -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