Skip to content

Commit

Permalink
fix cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Kusumgar committed Feb 28, 2024
1 parent fe2414b commit 3c6d370
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion R/queue.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Queue <- R6::R6Class("Queue", #nolint

#' @description Destroy queue
finalize = function() {
rrq::rrq_destroy(self$controller)
rrq::rrq_destroy(controller = self$controller)
}
),
)
Expand Down
8 changes: 3 additions & 5 deletions tests/testthat/helper-orderly-runner.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@ new_queue_quietly <- function(root, ...) {
suppressMessages(Queue$new(root, ...))
}

start_queue_workers_quietly <- function(n_workers, controller) {
start_queue_workers_quietly <- function(n_workers,
controller, env = parent.frame()) {
suppressMessages(
rrq::rrq_worker_spawn2(n_workers, controller = controller)
)
}

kill_queue_workers <- function(controller) {
rrq::rrq_worker_stop(controller = controller)
withr::defer(rrq::rrq_worker_stop(controller = controller), env = env)
}

skip_if_no_redis <- function() {
Expand Down
1 change: 0 additions & 1 deletion tests/testthat/test-queue.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ test_that("Can bring up queue", {
expect_equal(q$number_of_workers(), 0)
start_queue_workers_quietly(1, q$controller)
expect_equal(q$number_of_workers(), 1)
kill_queue_workers(q$controller)
})


Expand Down

0 comments on commit 3c6d370

Please sign in to comment.