Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Oct 28, 2020. It is now read-only.

Commit eb8d0eb

Browse files
Log the process of analyzing all the tables
1 parent f6fea7b commit eb8d0eb

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)

AltStyle によって変換されたページ (->オリジナル) /