Skip to content
GitLab
Next
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
GitLab FOSS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
4
Snippets
Groups
Projects
Show more breadcrumbs
GitLab.org
GitLab FOSS
Commits
1393f8dd
There was a problem fetching the pipeline summary.
Commit
1393f8dd
authored
7 years ago
by
Sean McGivern
Browse files
Options
Downloads
Plain Diff
Merge branch 'fix-34019' into 'master'
Perform project housekeeping after importing projects Closes
#34019
See merge request
!12323
parents
ae5a0207
429c3ccc
No related branches found
No related tags found
Loading
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/models/project.rb
+16
-1
16 additions, 1 deletion
app/models/project.rb
changelogs/unreleased/fix-34019.yml
+4
-0
4 additions, 0 deletions
changelogs/unreleased/fix-34019.yml
with
20 additions
and
1 deletion
app/models/project.rb
+
16
−
1
View file @
1393f8dd
...
...
@@ -350,7 +350,10 @@ def self.with_feature_available_for_user(feature, user)
project
.
run_after_commit
{
add_import_job
}
end
after_transition
started: :finished
,
do: :reset_cache_and_import_attrs
after_transition
started: :finished
do
|
project
,
_
|
project
.
reset_cache_and_import_attrs
project
.
perform_housekeeping
end
end
class
<<
self
...
...
@@ -510,6 +513,18 @@ def reset_cache_and_import_attrs
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
...
...
This diff is collapsed.
Click to expand it.
changelogs/unreleased/fix-34019.yml
0 → 100644
+
4
−
0
View file @
1393f8dd
---
title
:
Perform project housekeeping after importing projects
merge_request
:
author
:
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment