open uri too many open files. UriAdapter missing close statement #1022

Closed
trcarden opened this Issue Sep 18, 2012 · 2 comments

Comments

Projects
None yet
3 participants
@trcarden

When importing a bunch of URIs into paperclip i use the UriAdapter. It works great. However its missing a close call (see below). You need to either pass a block to uri-open. Since the code doesn't lend itself to a block just close it after the copy.

module Paperclip
  class UriAdapter < AbstractAdapter
   def initialize(target)
    @target = target
    @content = download_content
    cache_current_values
    @tempfile = copy_to_tempfile(@content)

   # Missing this:
   # @content.close

 end
@masterkain

This comment has been minimized.

Show comment
Hide comment

+1 I guess

@djcp

This comment has been minimized.

Show comment
Hide comment
@djcp

djcp Dec 7, 2012

Contributor

Should be fixed here: d71cc2d

Contributor

djcp commented Dec 7, 2012

Should be fixed here: d71cc2d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment