paperclipftp 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/paperclipftp.rb +5 -14
  3. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.3
1
+ 0.2.4
@@ -19,26 +19,17 @@ module Paperclip
19
19
  end
20
20
  end
21
21
 
22
- #class << self; attr_accessor :ftp_conn; end
23
-
24
22
  def exists?(style = default_style)
25
- first_try = true
26
23
  begin
27
24
  Timeout::timeout(@timeout, FtpTimeout) do
28
25
  file_size(ftp_path(style)) > 0
29
26
  end
30
- rescue FtpTimeout => e
31
- # we are really timing out here, lets honor the contract
32
- raise e
33
27
  rescue Timeout::Error => e
34
- # sometimes those spurious timeout occur pretty much instantly, and are very disruptive
35
- # in case they happen, lets try one more time before giving up
36
- if first_try
37
- first_try = false
38
- retry
39
- else
40
- raise e
41
- end
28
+ # either a true timeout or a spurious one, solution is simple, close connection and
29
+ # re-raise exception, it is up to higher layers to retry on failure
30
+ debug "Timed out in exists?"
31
+ close_ftp_connection
32
+ raise e
42
33
  end
43
34
  end
44
35
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paperclipftp
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 3
10
- version: 0.2.3
9
+ - 4
10
+ version: 0.2.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Damian Caruso