From 137203c01aacad5bf93a586dc8c0a8a8f2b4e4c0 Mon Sep 17 00:00:00 2001 From: ckolivas Date: Sat, 17 Jan 2015 22:50:40 +1100 Subject: [PATCH] Count each idle client as an idle worker instead of per workername --- src/stratifier.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/stratifier.c b/src/stratifier.c index 59eaaf52..99dac9e9 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -3502,7 +3502,7 @@ static void *statsupdate(void *arg) decay_time(&client->dsps10080, 0, per_tdiff, 604800); if (per_tdiff > 600) client->idle = true; - continue; + idle_workers++; } } @@ -3514,7 +3514,7 @@ static void *statsupdate(void *arg) /* Decay times per worker */ DL_FOREACH(instance->worker_instances, worker) { /* FIXME: This shouldn't happen and is purely a sanity - * breakout till the real issue is found fixed. */ + * breakout till the real issue is found and fixed. */ if (unlikely(iterations++ > instance->workers)) { LOGWARNING("Statsupdate trying to iterate more than %d existing workers for worker %s", instance->workers, worker->workername); @@ -3526,7 +3526,6 @@ static void *statsupdate(void *arg) decay_time(&worker->dsps5, 0, per_tdiff, 300); decay_time(&worker->dsps60, 0, per_tdiff, 3600); decay_time(&worker->dsps1440, 0, per_tdiff, 86400); - idle_workers++; worker->idle = true; } ghs = worker->dsps1 * nonces;