mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-13 22:59:19 +10:00
Merge branch 'fix/gitlab-import-project-file-fix' into 'master'
Fix temp file being deleted after the request while importing a GitLab project Fixes https://gitlab.com/gitlab-com/infrastructure/issues/151 In production, the temporary uploaded file is getting deleted straight after the request so the Sidekiq worker is unable to find it in `/tmp` Also, improved erroring/logging of this situation. See merge request !4894
This commit is contained in:
committed by
Robert Speicher
parent
12af7464cf
commit
ac7cea3084
@@ -12,9 +12,13 @@ class Import::GitlabProjectsController < Import::BaseController
|
||||
return redirect_back_or_default(options: { alert: "You need to upload a GitLab project export archive." })
|
||||
end
|
||||
|
||||
imported_file = project_params[:file].path + "-import"
|
||||
|
||||
FileUtils.copy_entry(project_params[:file].path, imported_file)
|
||||
|
||||
@project = Gitlab::ImportExport::ProjectCreator.new(project_params[:namespace_id],
|
||||
current_user,
|
||||
File.expand_path(project_params[:file].path),
|
||||
File.expand_path(imported_file),
|
||||
project_params[:path]).execute
|
||||
|
||||
if @project.saved?
|
||||
|
||||
Reference in New Issue
Block a user