You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2017/04/09 04:49:54 UTC

[couchdb] branch 63012-scheduler updated: [fixup] invert if logic to save space in scheduler

This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a commit to branch 63012-scheduler
in repository https://gitbox.apache.org/repos/asf/couchdb.git

The following commit(s) were added to refs/heads/63012-scheduler by this push:
       new  1152db2   [fixup] invert if logic to save space in scheduler
1152db2 is described below

commit 1152db292ecb2acc1d01a810d88ce935b3845ff4
Author: Nick Vatamaniuc <va...@apache.org>
AuthorDate: Sun Apr 9 00:49:49 2017 -0400

    [fixup] invert if logic to save space in scheduler
---
 src/couch_replicator/src/couch_replicator_scheduler.erl | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/couch_replicator/src/couch_replicator_scheduler.erl b/src/couch_replicator/src/couch_replicator_scheduler.erl
index ec2aa47..e9159b9 100644
--- a/src/couch_replicator/src/couch_replicator_scheduler.erl
+++ b/src/couch_replicator/src/couch_replicator_scheduler.erl
@@ -651,17 +651,13 @@ reschedule(State) ->
 stop_excess_jobs(State, Running) ->
     #state{max_jobs=MaxJobs} = State,
     StopCount = Running - MaxJobs,
-    if StopCount > 0 ->
+    if StopCount =< 0 -> ok; true ->
         Stopped = stop_jobs(StopCount, true, State),
         OneshotLeft = StopCount - Stopped,
-        if OneshotLeft > 0 ->
+        if OneshotLeft =< 0 -> ok; true ->
             stop_jobs(OneshotLeft, false, State),
-            ok;
-        true ->
             ok
-        end;
-    true ->
-        ok
+        end
     end.
 
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@couchdb.apache.org" <co...@couchdb.apache.org>'].