Commit 7fc6d5f6 authored by Sean McGivern's avatar Sean McGivern

Add Sidekiq worker context for project imports

When an import job is created on project creation, it doesn't have
project context metadata in our Sidekiq logs because the controller
doesn't know the project name yet. This fixes that.

It's not clear why the call to `#import_schedule` isn't guarded by
`@project.persisted?` in the same way as `#after_create_actions`, but
this preserves the existing behaviour.
parent 40fff8cc
......@@ -55,13 +55,11 @@ module Projects
save_project_and_import_data
if @project.persisted?
Gitlab::ApplicationContext.with_context(related_class: "Projects::CreateService", project: @project) do
after_create_actions
end
end
Gitlab::ApplicationContext.with_context(related_class: "Projects::CreateService", project: @project) do
after_create_actions if @project.persisted?
import_schedule
import_schedule
end
@project
rescue ActiveRecord::RecordInvalid => e
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment