Skip to content

Commit

Permalink
no cleanup tmp after normalize if error occurs
Browse files Browse the repository at this point in the history
  • Loading branch information
peetucket committed Mar 12, 2024
1 parent adffc50 commit 2fee274
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/gis_robot_suite/raster_normalizer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ def initialize(logger:, cocina_object:, rootdir:)

def with_normalized
yield normalize
ensure
cleanup
# ensure
# cleanup
end

# @return [String] the path to the normalized raster
Expand All @@ -24,6 +24,7 @@ def normalize
epsg4326_projection? ? compress_only : reproject_and_compress
convert_8bit_to_rgb if eight_bit?
compute_statistics
cleanup
tmpdir
end

Expand Down
2 changes: 1 addition & 1 deletion spec/robots/dor_repo/gis_delivery/load_raster_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
let(:tif_filename) { "/tmp/normalizeraster_#{bare_druid}/MCE_FI2G_2014.tif" }
let(:destination_path) { '/geotiff' }
let(:cmd_tif_sync) { "rsync -v '#{tif_filename}' #{destination_path}/#{bare_druid}.tif" }
let(:cmd_aux_sync) { "rsync -v '#{tif_filename}'.aux.xml #{destination_path}/#{bare_druid}.tif.aux.xml" }
let(:cmd_aux_sync) { "rsync -v '#{tif_filename}.aux.xml' #{destination_path}/#{bare_druid}.tif.aux.xml" }
let(:robot) { described_class.new }
let(:workflow_client) { instance_double(Dor::Workflow::Client) }
let(:object_client) { instance_double(Dor::Services::Client::Object, find: cocina_object) }
Expand Down

0 comments on commit 2fee274

Please sign in to comment.