lib/ridley/resources/sandbox_resource.rb in ridley-0.12.3 vs lib/ridley/resources/sandbox_resource.rb in ridley-0.12.4

- old
+ new

@@ -2,13 +2,11 @@ # @author Jamie Winsor <reset@riotgames.com> class SandboxResource < Ridley::Resource set_resource_path "sandboxes" represented_by Ridley::SandboxObject - finalizer do - uploader.terminate if uploader && uploader.alive? - end + finalizer :finalize_callback def initialize(connection_registry, client_name, client_key, options = {}) super(connection_registry) options = options.reverse_merge(pool_size: 4) @uploader = SandboxUploader.pool(size: options[:pool_size], args: [ client_name, client_key, options ]) @@ -97,7 +95,11 @@ end private attr_reader :uploader + + def finalize_callback + uploader.terminate if uploader && uploader.alive? + end end end