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
Boxiang Sun
gitlab-ce
Commits
6a9851ea
Commit
6a9851ea
authored
Jun 28, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Perform housekeeping only when an import of a fresh project is completed
parent
d3c3200c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
17 deletions
+10
-17
app/models/project.rb
app/models/project.rb
+10
-17
No files found.
app/models/project.rb
View file @
6a9851ea
...
...
@@ -352,7 +352,16 @@ class Project < ActiveRecord::Base
after_transition
started: :finished
do
|
project
,
_
|
project
.
reset_cache_and_import_attrs
project
.
perform_housekeeping
if
Gitlab
::
ImportSources
.
importer_names
.
include?
(
project
.
import_type
)
&&
project
.
repo_exists?
project
.
run_after_commit
do
begin
Projects
::
HousekeepingService
.
new
(
project
).
execute
rescue
Projects
::
HousekeepingService
::
LeaseTaken
=>
e
Rails
.
logger
.
info
(
"Could not perform housekeeping for project
#{
project
.
path_with_namespace
}
(
#{
project
.
id
}
):
#{
e
}
"
)
end
end
end
end
end
...
...
@@ -510,22 +519,6 @@ class Project < ActiveRecord::Base
ProjectCacheWorker
.
perform_async
(
self
.
id
)
end
remove_import_data
end
def
perform_housekeeping
return
unless
repo_exists?
run_after_commit
do
begin
Projects
::
HousekeepingService
.
new
(
self
).
execute
rescue
Projects
::
HousekeepingService
::
LeaseTaken
=>
e
Rails
.
logger
.
info
(
"Could not perform housekeeping for project
#{
self
.
path_with_namespace
}
(
#{
self
.
id
}
):
#{
e
}
"
)
end
end
end
def
remove_import_data
import_data
&
.
destroy
end
...
...
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