OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Remove retry as diskfile is already accessible
Oliver Günther2fcfa3ed3f79
diff --git a/modules/bim/app/models/bim/ifc_models/ifc_model.rb b/modules/bim/app/models/bim/ifc_models/ifc_model.rbindex 1c39223297d..801cf04de62 100644--- a/modules/bim/app/models/bim/ifc_models/ifc_model.rb+++ b/modules/bim/app/models/bim/ifc_models/ifc_model.rb@@ -38,13 +38,6 @@ module Bimxkt_attachment.present?end- ##- # Test if the ifc attachment is readable.- # Note that it has to access the diskfile and potentially download from storage for that(!)- def ifc_attachment_ready?- !ifc_attachment.prepared? && ifc_attachment.diskfile.present?- end-private##diff --git a/modules/bim/app/workers/bim/ifc_models/ifc_conversion_job.rb b/modules/bim/app/workers/bim/ifc_models/ifc_conversion_job.rbindex dfacd81f19d..1366f79242e 100644--- a/modules/bim/app/workers/bim/ifc_models/ifc_conversion_job.rb+++ b/modules/bim/app/workers/bim/ifc_models/ifc_conversion_job.rb@@ -6,8 +6,6 @@ module Bim### Run the conversion of IFC todef perform(ifc_model)- return retry_job(wait: 1.minute) if attachment_missing?(ifc_model)-User.system.run_given doresult = ViewConverterService.new(ifc_model).call@@ -17,14 +15,6 @@ module Bimendendend-- private-- ##- # Is the ifc attachment of the model ready for consumption?- def attachment_missing?(ifc_model)- !ifc_model.ifc_attachment_ready?- endendendenddiff --git a/modules/bim/spec/workers/ifc_conversion_job_spec.rb b/modules/bim/spec/workers/ifc_conversion_job_spec.rbindex 460d81c6627..547842ac190 100644--- a/modules/bim/spec/workers/ifc_conversion_job_spec.rb+++ b/modules/bim/spec/workers/ifc_conversion_job_spec.rb@@ -2,46 +2,13 @@ require 'spec_helper'describe Bim::IfcModels::IfcConversionJob, type: :job dolet(:model) { FactoryBot.build :ifc_model }- let(:instance) { described_class.new }- let(:attachment_double) { instance_double(Attachment) }- let(:prepared) { false }- let(:diskfile) { 'foo' }-- subject { instance.perform(model) }-- before do- allow(model).to receive(:ifc_attachment).and_return(attachment_double)- allow(attachment_double).to receive(:diskfile).and_return diskfile- allow(attachment_double).to receive(:prepared?).and_return prepared- end+ subject { described_class.perform_now(model) }it 'calls the conversion service' doexpect(::Bim::IfcModels::ViewConverterService).to receive_message_chain(:new, :call)- .and_return ServiceResult.new success: true+ .and_return ServiceResult.new success: trueexpect { subject }.not_to raise_errorend-- shared_examples 'will reschedule' do- it 'will reschedule the job' do- allow(instance).to receive(:retry_job)-- subject-- expect(instance).to have_received(:retry_job).with(wait: 1.minute)- end- end-- context 'when the diskfile is empty' do- let(:diskfile) { nil }-- it_behaves_like 'will reschedule'- end-- context 'when the attachment is not persisted' do- let(:prepared) { true }-- it_behaves_like 'will reschedule'- endend