cazala / coin-hive-stratum

use CoinHive's JavaScript miner on any stratum pool
http://npmjs.com/package/coin-hive-stratum
416 stars 465 forks source link

Automatic connection close? #143

Open DickyT opened 6 years ago

DickyT commented 6 years ago

Hi, I noticed that even if we disconnect all the miners, the /stats page will still have 1 connection. Is there any way to end the connections automatically if there is no miners?

{
  miners: 0,
  connections: 1
}

Environment: I am using pm2 to run the proxy, with a proxy.js file.

adamdupuis commented 6 years ago

I don't have any answers on this, but I'm curious as to why this is a problem for you.

DickyT commented 6 years ago

@adamdupuis Actually I am just afraid the empty connection will consume more system resource, since the connection should be useless when there is no miners connected.

cazala commented 6 years ago

there use to be a process that purged empty connection but it wasn't working right, so now connections are there forever. It shouldn't be a big problem tho.