Skip to content

Commit

Permalink
Add comment on expiration query
Browse files Browse the repository at this point in the history
  • Loading branch information
djmb committed Sep 10, 2024
1 parent f1d3f57 commit ec6b58c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/solid_cache/entry/expiration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ def expiry_candidate_ids(count, max_age:, max_entries:, max_size:)
candidates.pluck(:id)
else
min_created_at = max_age.seconds.ago
# We don't have an index on created_at, but we can select
# the records by id and they'll be in created_at order.
candidates.pluck(:id, :created_at)
.filter_map { |id, created_at| id if created_at < min_created_at }
end
Expand Down

0 comments on commit ec6b58c

Please sign in to comment.