lato_storage 3.0.7 → 3.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/jobs/lato_storage/preload_dashboard_data_job.rb +10 -1
- data/lib/lato_storage/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7052d0a8dbea49286dfc1be1303270feb89d046a5e667e47c31090fe1da58d1f
|
4
|
+
data.tar.gz: 2bf961008e489700ebcd94501bb11e36c60f6363dcb1c21b303c5ba688d27709
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e81ee975f7ec956ca04fdc3fd434494c7c40b9c8af50886a4852eed8955e2b58c7ca5b694533f565127462465f6d08d80da4d772ef002111a6cb6a01bb0241f
|
7
|
+
data.tar.gz: fdd06ab53fe93ecd2448b0561d81353f32a9a238402896a59946015839bb7ada2408d931eaead9a9e96c051f98c085de6f3c9d43d8ebdf9d7d8d8a6de068378b
|
@@ -31,7 +31,16 @@ module LatoStorage
|
|
31
31
|
blobs_count = ActiveStorage::Blob.count
|
32
32
|
attachments_count = ActiveStorage::Attachment.count
|
33
33
|
variant_records_count = defined?(ActiveStorage::VariantRecord) ? ActiveStorage::VariantRecord.count : 0
|
34
|
-
deletable_blobs_count = ActiveStorage::Blob.unattached.where('active_storage_blobs.created_at < ?', 12.hours.ago).count
|
34
|
+
# deletable_blobs_count = ActiveStorage::Blob.unattached.where('active_storage_blobs.created_at < ?', 12.hours.ago).count
|
35
|
+
deletable_blobs_count = ActiveRecord::Base.connection.execute(
|
36
|
+
<<~SQL
|
37
|
+
SELECT COUNT(*)
|
38
|
+
FROM active_storage_blobs asb
|
39
|
+
LEFT JOIN active_storage_attachments asa ON asa.blob_id = asb.id
|
40
|
+
WHERE asa.blob_id IS NULL
|
41
|
+
AND asb.created_at < '#{12.hours.ago.to_formatted_s(:db)}'
|
42
|
+
SQL
|
43
|
+
).first['count'].to_i
|
35
44
|
total_storage = ActiveStorage::Blob.sum(:byte_size)
|
36
45
|
avg_storage = blobs_count.positive? ? total_storage / blobs_count : 0
|
37
46
|
content_types = ActiveStorage::Blob.group(:content_type).count.sort_by { |_, count| -count }.first(5)
|
data/lib/lato_storage/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lato_storage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregorio Galante
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-07-
|
11
|
+
date: 2025-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|