Skip to content

Commit

Permalink
Adjust trim_chance to replicate solid_cache
Browse files Browse the repository at this point in the history
  • Loading branch information
npezza93 committed Sep 17, 2024
1 parent d81ebe4 commit ae1102a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/solid_cable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def autotrim?
end

def trim_batch_size
if (size = cable_config.trim_batch_size.to_i) < 1
if (size = cable_config.trim_batch_size.to_i) < 2
100
else
size
Expand All @@ -42,9 +42,10 @@ def use_skip_locked
# many records. This ensures there is downward pressure on the cache size
# while there is valid data to delete. Read this as 'every time the trim job
# runs theres a trim_multiplier chance this trims'. Adjust number to make it
# more or less likely to trim.
# more or less likely to trim. Only works like this if trim_batch_size is
# 100
def trim_chance
10
2
end

private
Expand Down

0 comments on commit ae1102a

Please sign in to comment.