Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
8021a724
Commit
8021a724
authored
Jul 17, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expire content cache when repository fetch fails
parent
517a9f97
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
lib/github/import.rb
lib/github/import.rb
+3
-2
No files found.
lib/github/import.rb
View file @
8021a724
...
@@ -75,6 +75,7 @@ module Github
...
@@ -75,6 +75,7 @@ module Github
true
true
rescue
Github
::
RepositoryFetchError
rescue
Github
::
RepositoryFetchError
expire_repository_cache
false
false
ensure
ensure
keep_track_of_errors
keep_track_of_errors
...
@@ -88,7 +89,7 @@ module Github
...
@@ -88,7 +89,7 @@ module Github
project
.
repository
.
add_remote
(
'github'
,
repo_url
)
project
.
repository
.
add_remote
(
'github'
,
repo_url
)
project
.
repository
.
set_remote_as_mirror
(
'github'
)
project
.
repository
.
set_remote_as_mirror
(
'github'
)
project
.
repository
.
fetch_remote
(
'github'
,
forced:
true
)
project
.
repository
.
fetch_remote
(
'github'
,
forced:
true
)
rescue
Gitlab
::
Shell
::
Error
=>
e
rescue
Gitlab
::
Git
::
Repository
::
NoRepository
,
Gitlab
::
Shell
::
Error
=>
e
error
(
:project
,
repo_url
,
e
.
message
)
error
(
:project
,
repo_url
,
e
.
message
)
raise
Github
::
RepositoryFetchError
raise
Github
::
RepositoryFetchError
end
end
...
@@ -368,7 +369,7 @@ module Github
...
@@ -368,7 +369,7 @@ module Github
end
end
def
expire_repository_cache
def
expire_repository_cache
repository
.
expire_content_cache
repository
.
expire_content_cache
if
project
.
repository_exists?
end
end
def
keep_track_of_errors
def
keep_track_of_errors
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment