toree-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lrese...@apache.org
Subject [1/2] incubator-toree git commit: [TOREE-474] support for custom resolvers (for %AddDeps)
Date Tue, 25 Sep 2018 16:35:03 GMT
Repository: incubator-toree
Updated Branches:
  refs/heads/master 5e7e29ddc -> f58a86f2a


[TOREE-474] support for custom resolvers (for %AddDeps)

The code path where downloadTotal is set is inconsistently
reached for certain repositories, like Artifactory.

Closes #162


Project: http://git-wip-us.apache.org/repos/asf/incubator-toree/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-toree/commit/387d6e10
Tree: http://git-wip-us.apache.org/repos/asf/incubator-toree/tree/387d6e10
Diff: http://git-wip-us.apache.org/repos/asf/incubator-toree/diff/387d6e10

Branch: refs/heads/master
Commit: 387d6e1099387981ab5bf73fe6dcdd435ef078f7
Parents: 5e7e29d
Author: Russell McEntyre <rmcentyre@users.noreply.github.com>
Authored: Thu Sep 20 12:06:49 2018 -0700
Committer: Luciano Resende <lresende@apache.org>
Committed: Tue Sep 25 12:33:12 2018 -0400

----------------------------------------------------------------------
 .../apache/toree/dependencies/CoursierDependencyDownloader.scala   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/387d6e10/kernel-api/src/main/scala/org/apache/toree/dependencies/CoursierDependencyDownloader.scala
----------------------------------------------------------------------
diff --git a/kernel-api/src/main/scala/org/apache/toree/dependencies/CoursierDependencyDownloader.scala
b/kernel-api/src/main/scala/org/apache/toree/dependencies/CoursierDependencyDownloader.scala
index 89a5e9c..811e85b 100644
--- a/kernel-api/src/main/scala/org/apache/toree/dependencies/CoursierDependencyDownloader.scala
+++ b/kernel-api/src/main/scala/org/apache/toree/dependencies/CoursierDependencyDownloader.scala
@@ -252,7 +252,7 @@ class CoursierDependencyDownloader extends DependencyDownloader {
     override def downloadProgress(url: String, downloaded: Long): Unit = {
       downloadAmount.put(url, downloaded)
 
-      val ratio = downloadAmount(url).toDouble / downloadTotal(url).toDouble
+      val ratio = downloadAmount(url).toDouble / downloadTotal.getOrElse[Long](url, 1).toDouble
       val percent = ratio * 100.0
 
       if (trace) printStream.printf(


Mime
View raw message