Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
paperclip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
paperclip
Commits
56c30229
Commit
56c30229
authored
Aug 29, 2014
by
Jon Yurek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Exponential Backup with 0.5s, not 500s
parent
5b22af36
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
lib/paperclip/storage/s3.rb
+2
-2
spec/paperclip/storage/s3_spec.rb
+5
-1
No files found.
lib/paperclip/storage/s3.rb
View file @
56c30229
...
...
@@ -363,8 +363,8 @@ module Paperclip
retry
rescue
AWS
::
S3
::
Errors
::
SlowDown
retries
+=
1
if
retries
<=
3
sleep
((
retries
**
2
)
*
500
)
if
retries
<=
5
sleep
((
2
**
retries
)
*
0.5
)
retry
else
raise
...
...
spec/paperclip/storage/s3_spec.rb
View file @
56c30229
...
...
@@ -717,7 +717,11 @@ describe Paperclip::Storage::S3 do
raises
(
AWS
::
S3
::
Errors
::
SlowDown
.
new
(
stub
,
stub
(
status:
503
,
body:
""
)))
expect
{
@dummy
.
save
}.
to
raise_error
(
AWS
::
S3
::
Errors
::
SlowDown
)
expect
(
@dummy
.
avatar
).
to
have_received
(
:sleep
).
times
(
3
)
expect
(
@dummy
.
avatar
).
to
have_received
(
:sleep
).
with
(
1
)
expect
(
@dummy
.
avatar
).
to
have_received
(
:sleep
).
with
(
2
)
expect
(
@dummy
.
avatar
).
to
have_received
(
:sleep
).
with
(
4
)
expect
(
@dummy
.
avatar
).
to
have_received
(
:sleep
).
with
(
8
)
expect
(
@dummy
.
avatar
).
to
have_received
(
:sleep
).
with
(
16
)
end
context
"and saved"
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment