Skip to content

Commit 103ed97

Browse files
committed
Log record deletion after exclusion
1 parent b22b39b commit 103ed97

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/database/old_record_cleanup.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ def delete
2020
last_record = model.order(:id).last
2121
old_records = old_records.where(Sequel.lit('id < ?', last_record.id)) if last_record
2222
end
23-
logger.info("Cleaning up #{old_records.count} #{model.table_name} table rows")
24-
2523
old_records = exclude_running_records(old_records) if keep_running_records
2624

25+
logger.info("Cleaning up #{old_records.count} #{model.table_name} table rows")
26+
2727
Database::BatchDelete.new(old_records, 1000).delete
2828
end
2929

0 commit comments

Comments
 (0)