mirror of
https://github.com/Rucknium/xmrpeers.git
synced 2024-12-22 11:39:23 +00:00
Fix number of threads bug for ping.peers()
This commit is contained in:
parent
cb5227be7f
commit
0a82cf111c
1 changed files with 3 additions and 1 deletions
4
R/ping.R
4
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
|
||||
|
|
Loading…
Reference in a new issue