Skip to content

Commit

Permalink
[Automated] Merged master into target preview_envs_k8s
Browse files Browse the repository at this point in the history
  • Loading branch information
va-vsp-bot authored Mar 26, 2024
2 parents 2db5be3 + 7f0a6ce commit 57344b5
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ class UploadProcessor
sidekiq_options unique_for: 30.days

def perform(guid, caller_data, retries = 0)
return if cancelled?

response = nil
brt = Benchmark.realtime do
# @retries variable used via the CentralMail::Utilities which is included via VBADocuments::UploadValidations
Expand All @@ -46,20 +44,6 @@ def perform(guid, caller_data, retries = 0)
response&.success? ? true : false
end

def cancelled?
Sidekiq.redis do |c|
if c.respond_to? :exists?
c.exists?("cancelled-#{jid}")
else
c.exists("cancelled-#{jid}")
end
end
end

def self.cancel!(jid)
Sidekiq.redis { |c| c.setex("cancelled-#{jid}", 86_400, 1) }
end

private

# rubocop:disable Metrics/MethodLength
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@
@md = JSON.parse(valid_metadata)
@upload_submission = VBADocuments::UploadSubmission.new
@upload_submission.update(status: 'uploaded')
allow_any_instance_of(VBADocuments::UploadProcessor).to receive(:cancelled?).and_return(false)
allow_any_instance_of(Tempfile).to receive(:size).and_return(1) # must be > 0 or submission will error w/DOC107
allow(VBADocuments::MultipartParser).to receive(:parse) {
{ 'metadata' => @md.to_json, 'content' => valid_doc }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@
@md = JSON.parse(valid_metadata)
@upload_submission = VBADocuments::UploadSubmission.new
@upload_submission.update(status: 'uploaded')
allow_any_instance_of(VBADocuments::UploadProcessor).to receive(:cancelled?).and_return(false)
allow_any_instance_of(Tempfile).to receive(:size).and_return(1) # must be > 0 or submission will error w/DOC107
allow(VBADocuments::MultipartParser).to receive(:parse) {
{ 'metadata' => @md.to_json, 'content' => valid_doc }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
end

before do
allow_any_instance_of(described_class).to receive(:cancelled?).and_return(false)
allow_any_instance_of(Tempfile).to receive(:size).and_return(1) # must be > 0 or submission will error w/DOC107
objstore = instance_double(VBADocuments::ObjectStore)
version = instance_double(Aws::S3::ObjectVersion)
Expand Down

0 comments on commit 57344b5

Please sign in to comment.