* Add: テーブル定義、内部処理 * Add: 通知の定期削除処理、自動削除、テスト * Add: Web画面の表示、設定 * Fix test
This commit is contained in:
parent
2cc60253c4
commit
f8280ca5d9
27 changed files with 300 additions and 9 deletions
17
app/lib/vacuum/list_statuses_vacuum.rb
Normal file
17
app/lib/vacuum/list_statuses_vacuum.rb
Normal file
|
@ -0,0 +1,17 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Vacuum::ListStatusesVacuum
|
||||
include Redisable
|
||||
|
||||
LIST_STATUS_LIFE_DURATION = 1.day.freeze
|
||||
|
||||
def perform
|
||||
vacuum_list_statuses!
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def vacuum_list_statuses!
|
||||
ListStatus.where('created_at < ?', LIST_STATUS_LIFE_DURATION.ago).in_batches.destroy_all
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue