* Wip * Wip * Wip: History * Wip: テストコード作成 * Fix test * Wip * Wip * Wip * Fix test * Wip * Wip * Wip * Wip * なんとか完成、これから動作確認 * spell miss * Change ng rule timings * Fix test * Wip * Fix test * Wip * Fix form * 表示まわりの改善
This commit is contained in:
parent
0779c748a6
commit
7d96d5828e
56 changed files with 2062 additions and 42 deletions
17
app/lib/vacuum/ng_histories_vacuum.rb
Normal file
17
app/lib/vacuum/ng_histories_vacuum.rb
Normal file
|
@ -0,0 +1,17 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Vacuum::NgHistoriesVacuum
|
||||
include Redisable
|
||||
|
||||
HISTORY_LIFE_DURATION = 7.days.freeze
|
||||
|
||||
def perform
|
||||
vacuum_histories!
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def vacuum_histories!
|
||||
NgRuleHistory.where('created_at < ?', HISTORY_LIFE_DURATION.ago).in_batches.destroy_all
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue