lato 3.13.0 → 3.13.1
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/README.md +1 -1
- data/app/jobs/lato/active_storage_cleaner_job.rb +9 -2
- data/lib/lato/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: f8746303f02bdbfbec09b41de82ff16a8b946ad67d760abd9b0638973944d260
|
4
|
+
data.tar.gz: e45f9374b5f00313250cdf8b8c325b0f79c6126c0d7bdfcfa4251949b3215cbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '096b30341931394fd8b0d09617c1484c475440bcc415f76db3fbc389df99574791c77c2913dce9832c0be9de9947f21581e5250d6ef8b48fed1677c43e8d9740'
|
7
|
+
data.tar.gz: 2b759b959aa4dc841987e2e05807f1e841e1887a4057f8d7f1c1abf51d2737964968b54553c4d19d1a92cc93ce9147e8ca4f911e64d4bd9bedaa57fa097bd9aa
|
data/README.md
CHANGED
@@ -19,7 +19,7 @@ The gem is ready to be used with the **latest Rails 7+** features like **[ESM im
|
|
19
19
|
|
20
20
|
## Full documentation
|
21
21
|
|
22
|
-
The full documentation is available at: 👉 👉 [THIS LINK](
|
22
|
+
The full documentation is available at: 👉 👉 [THIS LINK](https://auuu.link/s/gh-lato) 👈 👈
|
23
23
|
|
24
24
|
You can also use the [Lato AI Agent](http://lato.gregoriogalante.com/AI.html) directly on your browser to generate code and get helps with the gem.
|
25
25
|
|
@@ -1,9 +1,16 @@
|
|
1
1
|
module Lato
|
2
2
|
class ActiveStorageCleanerJob < Lato::ApplicationJob
|
3
|
-
def perform
|
3
|
+
def perform(params = {})
|
4
|
+
update_operation_percentage(0)
|
5
|
+
|
4
6
|
# delete all active storage blobs that are not attached to any record with more than 12 hours of life
|
5
|
-
ActiveStorage::Blob.
|
7
|
+
query = ActiveStorage::Blob.where('active_storage_blobs.created_at < ?', 12.hours.ago)
|
8
|
+
totals = query.count
|
9
|
+
runned = 0
|
10
|
+
query.find_in_batches do |blobs|
|
6
11
|
blobs.each(&:purge_later)
|
12
|
+
runned += blobs.size
|
13
|
+
update_operation_percentage((runned.to_f / totals * 100).round)
|
7
14
|
end
|
8
15
|
|
9
16
|
# delete all empty folders in active storage local service (if exists)
|
data/lib/lato/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lato
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.13.
|
4
|
+
version: 3.13.1
|
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-05-
|
11
|
+
date: 2025-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|