Skip to content
This repository was archived by the owner on Oct 28, 2020. It is now read-only.

Commit 8fedb0b

Browse files
authored
Merge pull request #3 from vassilevsky/master
Log the process of analyzing all the tables
2 parents afa98db + eb8d0eb commit 8fedb0b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/activerecord/overflow_signalizer.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,14 @@ def analyse!
3333
end
3434
next unless max
3535
if overflow_soon?(max, model)
36+
if (remaining = max - model.maximum(pk.name)) == 0
37+
@logger.warn("Table #{table} field #{pk.name} has overflown!")
38+
else
39+
@logger.warn("Table #{table} field #{pk.name} will overflow after #{remaining} records!")
40+
end
3641
overflowed_tables << [table, model.last.public_send(pk.name), max]
42+
else
43+
@logger.info("Table #{table} field #{pk.name} is not going to overflow in the next #{@days_count} days.")
3744
end
3845
end
3946
raise Overflow, overflow_message(overflowed_tables) if overflowed_tables.any?

0 commit comments

Comments
 (0)