Skip to content

Commit

Permalink
Fixes for infinite recursion and incorrect class check
Browse files Browse the repository at this point in the history
  • Loading branch information
azimov committed Jul 17, 2024
1 parent 55c32c3 commit 93baedc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ Suggests:
RSQLite,
duckdb,
RPostgres,
withr,
knitr,
rmarkdown,
keyring,
Expand Down
4 changes: 2 additions & 2 deletions R/PooledConnectionHandler.R
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ PooledConnectionHandler <- R6::R6Class(
#' Returns a connection from the pool
#' When the desired frame exits, the connection will be returned to the pool
#' @param .deferedFrame defaults to the parent frame of the calling block.
getConnection = function(.deferedFrame = parent.frame()) {
conn <- pool::poolCheckout(self$getConnection())
getConnection = function(.deferedFrame = parent.frame(n = 2)) {
conn <- pool::poolCheckout(super$getConnection())
withr::defer(pool::poolReturn(conn), envir = .deferedFrame)
return(conn)
},
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-ConnectionHandler.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@ test_that("Database Connector Class works", {
test_that("Pooled connector Class works", {
genericTests(PooledConnectionHandler,
classes = c("PooledConnectionHandler", "ConnectionHandler"),
connectionClass = "Pool"
connectionClass = "DatabaseConnectorDbiConnection"
)
})

0 comments on commit 93baedc

Please sign in to comment.