Skip to content

Commit ec6b58c

Browse files
committed
Add comment on expiration query
1 parent f1d3f57 commit ec6b58c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/models/solid_cache/entry/expiration.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ def expiry_candidate_ids(count, max_age:, max_entries:, max_size:)
4040
candidates.pluck(:id)
4141
else
4242
min_created_at = max_age.seconds.ago
43+
# We don't have an index on created_at, but we can select
44+
# the records by id and they'll be in created_at order.
4345
candidates.pluck(:id, :created_at)
4446
.filter_map { |id, created_at| id if created_at < min_created_at }
4547
end

0 commit comments

Comments
 (0)