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/13 19:08:51 UTC

[couchdb] branch 63012-scheduler updated: [fixup] timer -> send_after

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  9ea18be   [fixup] timer -> send_after
9ea18be is described below

commit 9ea18be44aca8b124621c92d8aebc6b36abbc792
Author: Nick Vatamaniuc <va...@apache.org>
AuthorDate: Thu Apr 13 15:08:39 2017 -0400

    [fixup] timer -> send_after
    
     And a small typo fix in the same scheduler module
---
 src/couch_replicator/src/couch_replicator_scheduler.erl | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/couch_replicator/src/couch_replicator_scheduler.erl b/src/couch_replicator/src/couch_replicator_scheduler.erl
index 3ba0403..9673344 100644
--- a/src/couch_replicator/src/couch_replicator_scheduler.erl
+++ b/src/couch_replicator/src/couch_replicator_scheduler.erl
@@ -205,7 +205,7 @@ init(_) ->
         ?DEFAULT_MAX_CHURN),
     MaxHistory = config:get_integer("replicator", "max_history",
         ?DEFAULT_MAX_HISTORY),
-    {ok, Timer} = timer:send_after(Interval, reschedule),
+    Timer = erlang:send_after(Interval, self(), reschedule),
     State = #state{
         interval = Interval,
         max_jobs = MaxJobs,
@@ -264,8 +264,8 @@ handle_cast(_, State) ->
 
 handle_info(reschedule, State) ->
     ok = reschedule(State),
-    {ok, cancel} = timer:cancel(State#state.timer),
-    {ok, Timer} = timer:send_after(State#state.interval, reschedule),
+    erlang:cancel_timer(State#state.timer),
+    Timer = erlang:send_after(State#state.interval, self(), reschedule),
     {noreply, State#state{timer = Timer}};
 
 handle_info({'DOWN', _Ref, process, Pid, normal}, State) ->
@@ -421,7 +421,7 @@ pending_fold(Job, {Set, Now, Count, HealthThreshold}) ->
              % to accumulator
              gb_sets:add_element({last_started(Job), Job}, Set);
         {false, _} ->
-             % This jobs is not healthy (has crashed too recently), so skip it.
+             % This job is not healthy (has crashed too recently), so skip it.
              Set
     end,
     {Set1, Now, Count, HealthThreshold}.

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