This instance will be upgraded to Heptapod 0.31.0 (final) on 2022-05-24 at 14:00 UTC+2 (a few minutes of down time)

Commit 68aca6f6 authored by James Lopez's avatar James Lopez
Browse files

trying to fix timing issue with import status

parent 1e8fb4ffcf04
......@@ -19,7 +19,10 @@ def create
if @project.import_failed?
@project.import_retry
else
@project.import_start
Project.transaction do
@project.import_start
end
@project.add_import_job if @project.persisted?
end
end
......
......@@ -246,7 +246,6 @@ def update_forks_visibility_level
state :finished
state :failed
after_transition any => :started, do: :schedule_add_import_job
after_transition any => :finished, do: :clear_import_data
end
......@@ -385,10 +384,6 @@ def saved?
id && persisted?
end
def schedule_add_import_job
run_after_commit(:add_import_job)
end
def add_import_job
if forked?
job_id = RepositoryForkWorker.perform_async(self.id, forked_from_project.path_with_namespace, self.namespace.path)
......
......@@ -59,6 +59,10 @@ def execute
end
end
Project.transaction do
@project.import_start if @project.import?
end
after_create_actions if @project.persisted?
@project
......@@ -95,8 +99,6 @@ def after_create_actions
unless @project.group
@project.team << [current_user, :master, current_user]
end
@project.import_start if @project.import?
end
end
end
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