Commit 19e40ff2 authored by Nick Thomas's avatar Nick Thomas

Resolve conflicts in Project model

parent 104132d7
......@@ -344,13 +344,10 @@ class Project < ActiveRecord::Base
event :import_fail do
transition [:scheduled, :started] => :failed
<<<<<<< HEAD
=======
end
event :import_retry do
transition failed: :started
>>>>>>> ce/master
end
state :scheduled
......@@ -358,18 +355,14 @@ class Project < ActiveRecord::Base
state :finished
state :failed
<<<<<<< HEAD
before_transition [:none, :finished, :failed] => :scheduled do |project, _|
project.mirror_data&.last_update_scheduled_at = Time.now
end
=======
>>>>>>> ce/master
after_transition [:none, :finished, :failed] => :scheduled do |project, _|
project.run_after_commit { add_import_job }
end
<<<<<<< HEAD
before_transition scheduled: :started do |project, _|
project.mirror_data&.last_update_started_at = Time.now
end
......@@ -417,9 +410,8 @@ class Project < ActiveRecord::Base
after_transition [:finished, :failed] => [:scheduled, :started] do |project, _|
Gitlab::Mirror.increment_capacity(project.id) if project.mirror?
end
=======
after_transition started: :finished, do: :reset_cache_and_import_attrs
>>>>>>> ce/master
end
class << self
......
......@@ -51,10 +51,7 @@ describe Project, models: true do
it { is_expected.to have_one(:project_feature).dependent(:destroy) }
it { is_expected.to have_one(:statistics).class_name('ProjectStatistics').dependent(:delete) }
it { is_expected.to have_one(:import_data).class_name('ProjectImportData').dependent(:delete) }
<<<<<<< HEAD
it { is_expected.to have_one(:mirror_data).class_name('ProjectMirrorData').dependent(:delete) }
=======
>>>>>>> ce/master
it { is_expected.to have_one(:last_event).class_name('Event') }
it { is_expected.to have_one(:forked_from_project).through(:forked_project_link) }
it { is_expected.to have_many(:commit_statuses) }
......@@ -1925,10 +1922,7 @@ describe Project, models: true do
expect(RepositoryImportWorker).to receive(:perform_async).with(project.id)
expect(RepositoryImportWorker).to receive(:perform_async).with(project.id)
project.add_import_job
end
project.add_import_job
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