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 @@ -63,18 +63,23 @@ def initialize(pool_config)
6363 adapter = pool_config . db_config . configuration_hash [ :adapter ]
6464 return if disable_telemetry || adapter != "cockroachdb"
6565
66- with_connection do |conn |
67- if conn . active?
68- begin
69- query = "SELECT crdb_internal.increment_feature_counter('ActiveRecord %d.%d')"
70- conn . execute ( query % [ ActiveRecord ::VERSION ::MAJOR , ActiveRecord ::VERSION ::MINOR ] )
71- rescue ActiveRecord ::StatementInvalid
72- # The increment_feature_counter built-in is not supported on this
73- # CockroachDB version. Ignore.
74- rescue StandardError => e
75- conn . logger . warn "Unexpected error when incrementing feature counter: #{ e } "
66+
67+ begin
68+ with_connection do |conn |
69+ if conn . active?
70+ begin
71+ query = "SELECT crdb_internal.increment_feature_counter('ActiveRecord %d.%d')"
72+ conn . execute ( query % [ ActiveRecord ::VERSION ::MAJOR , ActiveRecord ::VERSION ::MINOR ] )
73+ rescue ActiveRecord ::StatementInvalid
74+ # The increment_feature_counter built-in is not supported on this
75+ # CockroachDB version. Ignore.
76+ rescue StandardError => e
77+ conn . logger . warn "Unexpected error when incrementing feature counter: #{ e } "
78+ end
7679 end
7780 end
81+ rescue ActiveRecord ::NoDatabaseError
82+ # Prevent failures on db creation and parallel testing.
7883 end
7984 end
8085 end
You can’t perform that action at this time.
0 commit comments