File tree Expand file tree Collapse file tree 1 file changed +15
-10
lines changed
lib/active_record/connection_adapters Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -58,18 +58,23 @@ def initialize(spec)
5858 adapter = spec . config [ :adapter ]
5959 return if disable_telemetry || adapter != "cockroachdb"
6060
61- with_connection do |conn |
62- if conn . active?
63- begin
64- query = "SELECT crdb_internal.increment_feature_counter('ActiveRecord %d.%d')"
65- conn . execute ( query % [ ActiveRecord ::VERSION ::MAJOR , ActiveRecord ::VERSION ::MINOR ] )
66- rescue ActiveRecord ::StatementInvalid
67- # The increment_feature_counter built-in is not supported on this
68- # CockroachDB version. Ignore.
69- rescue StandardError => e
70- conn . logger . warn "Unexpected error when incrementing feature counter: #{ e } "
61+
62+ begin
63+ with_connection do |conn |
64+ if conn . active?
65+ begin
66+ query = "SELECT crdb_internal.increment_feature_counter('ActiveRecord %d.%d')"
67+ conn . execute ( query % [ ActiveRecord ::VERSION ::MAJOR , ActiveRecord ::VERSION ::MINOR ] )
68+ rescue ActiveRecord ::StatementInvalid
69+ # The increment_feature_counter built-in is not supported on this
70+ # CockroachDB version. Ignore.
71+ rescue StandardError => e
72+ conn . logger . warn "Unexpected error when incrementing feature counter: #{ e } "
73+ end
7174 end
7275 end
76+ rescue ActiveRecord ::NoDatabaseError
77+ # Prevent failures on db creation and parallel testing.
7378 end
7479 end
7580 end
You can’t perform that action at this time.
0 commit comments