alchemy-dragonfly-s3 5.1.4 → 5.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b7973574aa59a65ad12a8861ac4ce24825aa04780d2cf43e1ee7f0c3b4f91777
4
- data.tar.gz: db0c7a9674dd17ae160aa7342da1dfa09760415d9549ad89c74ccf6bdc85d223
3
+ metadata.gz: ec1c13a542a1b63dd195077cd647d1e1bc0bdfaeae8a4eb51b702566d5202c12
4
+ data.tar.gz: 646fe1fa7a99c9ee7cb68eb8cc1bbddbd78640624cfafb168f5fb9371239bce0
5
5
  SHA512:
6
- metadata.gz: 9e6e47191ff8914f98781a22751823e9070a1cc6aae57c8156e88ca44b4236a2ff18b801f885a463f8720cc99348d88c1b56938a3390828f7109d3ace235e571
7
- data.tar.gz: c1f4312d09b87cf37bf37778c681f9d0f45b68adaba6613096eb43a5ac1897f5d076685ec5e982183f270406d78150deceb9a30ceeda3fdde9acd57992aed813
6
+ metadata.gz: c16231755be826fc40a78542cfb864753a0403eed16feb51186d9e526c2c76dc450810a228105644a0233844fa97171e7a83d35bd52ecedcbdaf7205d639961a
7
+ data.tar.gz: 946cf698073d4940257b251f8f53eb1ef189b53c4bf91ea081ff3142360cef5ef05cbf97631a5fad8c2c51cc58a98f1048b41e3c5e6093439ddc323786181f03
data/README.md CHANGED
@@ -20,12 +20,14 @@ Add this line to your application's Gemfile:
20
20
  gem 'alchemy-dragonfly-s3', github: 'AlchemyCMS/alchemy-dragonfly-s3'
21
21
  ```
22
22
 
23
- For now you also need a special AlchemyCMS branch
23
+ For now you also need the master branch of AlchemyCMS*
24
24
 
25
25
  ```ruby
26
- gem 'alchemy_cms', github: 'tvdeyen/alchemy_cms', branch: 'remote-images'
26
+ gem 'alchemy_cms', github: 'AlchemyCMS/alchemy_cms', branch: 'master'
27
27
  ```
28
28
 
29
+ *only necessary until Alchemy 5.1 has been released.
30
+
29
31
  And then execute:
30
32
 
31
33
  ```
@@ -5,13 +5,23 @@ module Alchemy
5
5
  module S3
6
6
  class CreatePictureThumb
7
7
  def self.call(variant, signature, uid)
8
- image = variant.image
9
- image.store(path: uid)
10
- variant.picture.thumbs.create!(
8
+ # create the thumb before uploading
9
+ # to prevent db race conditions
10
+ thumb = variant.picture.thumbs.create!(
11
11
  picture: variant.picture,
12
12
  signature: signature,
13
13
  uid: uid,
14
14
  )
15
+ begin
16
+ # fetch and process the image
17
+ image = variant.image
18
+ # upload the processed image
19
+ image.store(path: uid)
20
+ rescue RuntimeError, Excon::Error => e
21
+ Rails.logger.warn(e)
22
+ # destroy the thumb if processing or upload fails
23
+ thumb.destroy
24
+ end
15
25
  end
16
26
  end
17
27
  end
@@ -3,7 +3,7 @@
3
3
  module Alchemy
4
4
  module Dragonfly
5
5
  module S3
6
- VERSION = "5.1.4"
6
+ VERSION = "5.1.5"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alchemy-dragonfly-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.4
4
+ version: 5.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas von Deyen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-17 00:00:00.000000000 Z
11
+ date: 2020-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: alchemy_cms