couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vatam...@apache.org
Subject [31/50] couch-replicator commit: updated refs/heads/63012-scheduler to 27a5eae
Date Tue, 14 Mar 2017 19:26:26 GMT
Fix job summary crash for local endpoints

Previously proxy url manipulation code assumed all endpoints to be remote.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/commit/cb2777b5
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/tree/cb2777b5
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/diff/cb2777b5

Branch: refs/heads/63012-scheduler
Commit: cb2777b50bcc98b8768daf9bad37366c5285667c
Parents: 85dece2
Author: Nick Vatamaniuc <vatamane@apache.org>
Authored: Fri Nov 25 11:47:56 2016 -0500
Committer: Nick Vatamaniuc <vatamane@apache.org>
Committed: Fri Nov 25 11:47:56 2016 -0500

----------------------------------------------------------------------
 src/couch_replicator_scheduler.erl | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/cb2777b5/src/couch_replicator_scheduler.erl
----------------------------------------------------------------------
diff --git a/src/couch_replicator_scheduler.erl b/src/couch_replicator_scheduler.erl
index f08e829..af2262b 100644
--- a/src/couch_replicator_scheduler.erl
+++ b/src/couch_replicator_scheduler.erl
@@ -119,12 +119,6 @@ job_summary(JobId, HealthThreshold) ->
                 {Pid, ErrorCount} when is_pid(Pid) ->
                      {running, null}
             end,
-            StrippedProxyURL = case (Rep#rep.source)#httpdb.proxy_url of
-                undefined ->
-                    null;
-                ProxyURL when is_list(ProxyURL) ->
-                    list_to_binary(couch_util:url_strip_password(ProxyURL))
-            end,
             [
                 {source, iolist_to_binary(ejson_url(Rep#rep.source))},
                 {target, iolist_to_binary(ejson_url(Rep#rep.target))},
@@ -133,13 +127,20 @@ job_summary(JobId, HealthThreshold) ->
                 {error_count, ErrorCount},
                 {last_updated, last_updated(History)},
                 {start_time, couch_replicator_utils:iso8601(Rep#rep.start_time)},
-                {proxy, StrippedProxyURL}
+                {proxy, job_proxy_url(Rep#rep.source)}
             ];
         {error, not_found} ->
             nil  % Job might have just completed
     end.
 
 
+job_proxy_url(#httpdb{proxy_url = ProxyUrl}) when is_list(ProxyUrl) ->
+    list_to_binary(couch_util:url_strip_password(ProxyUrl));
+
+job_proxy_url(_Endpoint) ->
+    null.
+
+
 -spec health_threshold() -> non_neg_integer().
 health_threshold() ->
     config:get_integer("replicator", "health_threshold",


Mime
View raw message