Skip to content

Commit b97ffa0

Browse files
authored
Add Purge Unattached Blobs Job (#3171)
1 parent 7bd98fe commit b97ffa0

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class PurgeUnattachedBlobsJob < ApplicationJob
2+
queue_as :default
3+
4+
def perform
5+
Rails.logger.info "Starting purge of unattached Active Storage blobs..."
6+
system("bin/pwpush active_storage:purge_unattached")
7+
Rails.logger.info "Completed purge of unattached Active Storage blobs"
8+
end
9+
end

config/recurring.yml

+10
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ production:
2525
queue: background
2626
schedule: every day at 5am
2727

28+
purge_unattached_blobs:
29+
class: PurgeUnattachedBlobsJob
30+
queue: background
31+
schedule: every 3 days
32+
2833
development:
2934
expire_pushes:
3035
class: ExpirePushesJob
@@ -40,3 +45,8 @@ development:
4045
class: CleanUpPushesJob
4146
queue: background
4247
schedule: every 7 hours
48+
49+
purge_unattached_blobs:
50+
class: PurgeUnattachedBlobsJob
51+
queue: background
52+
schedule: every 3 days

0 commit comments

Comments
 (0)