From 0a82cf111c4cd4d7ae104c0258e398c767bcb1d7 Mon Sep 17 00:00:00 2001 From: Rucknium Date: Tue, 16 Apr 2024 00:24:07 +0000 Subject: [PATCH] Fix number of threads bug for ping.peers() --- R/ping.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/R/ping.R b/R/ping.R index 0a37610..a605a5a 100644 --- a/R/ping.R +++ b/R/ping.R @@ -125,7 +125,9 @@ ping.peers <- function(bitmonero.dir = "~/.bitmonero", output.file = "monero_pee if (nrow(peers) * ping.count > 5) { if (is.null(threads)) { - n.workers <- min(c(floor(nrow(peers) * ping.count / 5), parallelly::availableCores()*4)) + n.workers <- min(c(floor(nrow(peers) * ping.count / 5), parallelly::availableCores()*4, 100) + } else { + n.workers <- threads } options(parallelly.maxWorkers.localhost = 4) # This means number of CPU cores times 4 # Most time in thread is waiting for ping to return, so can have