Skip to content

Commit

Permalink
refactor: Extract DRIVER_CLASS_NAME #47
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasz-gryzbon committed Apr 21, 2024
1 parent 9efd92f commit dd7a807
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ private const val INSERT_QUERY =
"insert into intercepted_interactions (trace_id, body, request_headers, response_headers, service_name, target, path, http_status, http_method, interaction_type, profile, elapsed_time, created_at) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"

private const val DEFAULT_CONNECTION_TIMEOUT_MILLIS = 500L
private const val DRIVER_CLASS_NAME = "org.postgresql.Driver"

class InterceptedDocumentPostgresRepository : InterceptedDocumentRepository {
private var active: Boolean = true
Expand Down Expand Up @@ -80,7 +81,7 @@ class InterceptedDocumentPostgresRepository : InterceptedDocumentRepository {
val config = HikariConfig()
config.initializationFailTimeout = connectionTimeout
config.jdbcUrl = dbConnectionString
config.driverClassName = "org.postgresql.Driver"
config.driverClassName = DRIVER_CLASS_NAME
this.dataSource = createDataSource(config, failOnConnectionError)
this.objectMapper = objectMapper
this.traceIdMaxLength = traceIdMaxLength
Expand Down

0 comments on commit dd7a807

Please sign in to comment.