alchemy_cms 6.1.1 → 6.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +3 -0
- data/CHANGELOG.md +4 -0
- data/app/models/alchemy/picture/url.rb +15 -6
- data/app/models/alchemy/picture_thumb/create.rb +5 -6
- data/lib/alchemy/version.rb +1 -1
- data/package.json +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2f303fbee5eb7ba00c41042f4a2c435e345621eae81768d8c66f86dad04d23d
|
4
|
+
data.tar.gz: e2ad0dfb05e0412676eb203c0ac7829d4945c8e8db879c8393748bb40089ce19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ec82e1628873bcfb3f1e16826087289ab1dcefe4bb98598ad320bce329c3f1481dc0df28fdbd0570a3fb79f6325de4a9eee510dd4dc6a981f3cc82565bd908b
|
7
|
+
data.tar.gz: 10c17180fbff27a83a2c6f052c200a9723858dea973f547206c9ca094e46b18bdc7130f5914e006acd058296b6783b4adafa47bc2bad87fca29ca6774673a973
|
data/.github/workflows/ci.yml
CHANGED
@@ -82,6 +82,9 @@ jobs:
|
|
82
82
|
sudo apt update -qq
|
83
83
|
sudo apt install -qq --fix-missing libmysqlclient-dev -o dir::cache::archives="/home/runner/apt/cache"
|
84
84
|
sudo chown -R runner /home/runner/apt/cache
|
85
|
+
- uses: actions/setup-node@v3
|
86
|
+
with:
|
87
|
+
node-version: 16
|
85
88
|
- name: Restore node modules cache
|
86
89
|
id: yarn-cache
|
87
90
|
uses: actions/cache@v2.1.3
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 6.1.2 (2023-02-27)
|
4
|
+
|
5
|
+
- [6.1] Fix thumbnail writing for multi-concurrent and multi-db setups [#2434](https://github.com/AlchemyCMS/alchemy_cms/pull/2434) ([tvdeyen](https://github.com/tvdeyen))
|
6
|
+
|
3
7
|
## 6.1.1 (2023-01-23)
|
4
8
|
|
5
9
|
- Re-introduce deleted methods [#2422](https://github.com/AlchemyCMS/alchemy_cms/pull/2422) ([tvdeyen](https://github.com/tvdeyen))
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Alchemy
|
4
4
|
class Picture < BaseRecord
|
5
5
|
class Url
|
6
|
-
attr_reader :variant
|
6
|
+
attr_reader :variant, :thumb
|
7
7
|
|
8
8
|
# @param [Alchemy::PictureVariant]
|
9
9
|
#
|
@@ -31,14 +31,23 @@ module Alchemy
|
|
31
31
|
|
32
32
|
def uid
|
33
33
|
signature = PictureThumb::Signature.call(variant)
|
34
|
-
|
35
|
-
|
36
|
-
uid = thumb.uid
|
34
|
+
if find_thumb_by(signature)
|
35
|
+
thumb.uid
|
37
36
|
else
|
38
37
|
uid = PictureThumb::Uid.call(signature, variant)
|
39
|
-
|
38
|
+
ActiveRecord::Base.connected_to(role: ActiveRecord::Base.writing_role) do
|
39
|
+
PictureThumb.generator_class.call(variant, signature, uid)
|
40
|
+
end
|
41
|
+
uid
|
40
42
|
end
|
41
|
-
|
43
|
+
end
|
44
|
+
|
45
|
+
def find_thumb_by(signature)
|
46
|
+
@thumb = if variant.picture.thumbs.loaded?
|
47
|
+
variant.picture.thumbs.find { |t| t.signature == signature }
|
48
|
+
else
|
49
|
+
variant.picture.thumbs.find_by(signature: signature)
|
50
|
+
end
|
42
51
|
end
|
43
52
|
end
|
44
53
|
end
|
@@ -19,11 +19,10 @@ module Alchemy
|
|
19
19
|
|
20
20
|
# create the thumb before storing
|
21
21
|
# to prevent db race conditions
|
22
|
-
thumb = Alchemy::PictureThumb.
|
23
|
-
picture
|
24
|
-
|
25
|
-
|
26
|
-
)
|
22
|
+
@thumb = Alchemy::PictureThumb.create_or_find_by!(signature: signature) do |thumb|
|
23
|
+
thumb.picture = variant.picture
|
24
|
+
thumb.uid = uid
|
25
|
+
end
|
27
26
|
begin
|
28
27
|
# process the image
|
29
28
|
image = variant.image
|
@@ -32,7 +31,7 @@ module Alchemy
|
|
32
31
|
rescue RuntimeError => e
|
33
32
|
ErrorTracking.notification_handler.call(e)
|
34
33
|
# destroy the thumb if processing or storing fails
|
35
|
-
thumb&.destroy
|
34
|
+
@thumb&.destroy
|
36
35
|
end
|
37
36
|
end
|
38
37
|
|
data/lib/alchemy/version.rb
CHANGED
data/package.json
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alchemy_cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.1.
|
4
|
+
version: 6.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas von Deyen
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2023-
|
16
|
+
date: 2023-02-27 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: actionmailer
|
@@ -1538,7 +1538,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1538
1538
|
version: '0'
|
1539
1539
|
requirements:
|
1540
1540
|
- ImageMagick (libmagick), v6.6 or greater.
|
1541
|
-
rubygems_version: 3.
|
1541
|
+
rubygems_version: 3.4.6
|
1542
1542
|
signing_key:
|
1543
1543
|
specification_version: 4
|
1544
1544
|
summary: A powerful, userfriendly and flexible CMS for Rails
|