From dc2fb45d6330cc6b9a38f424ac6d4318234129bd Mon Sep 17 00:00:00 2001 From: Nadav Samet Date: Thu, 23 Nov 2023 12:29:43 -0800 Subject: [PATCH] try --- bridge/src/main/scala/protocbridge/FileCache.scala | 7 +++++-- .../src/main/scala/protocbridge/ProtocCacheCoursier.scala | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bridge/src/main/scala/protocbridge/FileCache.scala b/bridge/src/main/scala/protocbridge/FileCache.scala index 7bca6d3..ae3c5a7 100644 --- a/bridge/src/main/scala/protocbridge/FileCache.scala +++ b/bridge/src/main/scala/protocbridge/FileCache.scala @@ -20,15 +20,18 @@ final class FileCache[K]( def get(key: K): Future[File] = { val f = fileForKey(key) val cm = completeMarker(key) - println(s"*** key=$key: ${cm.getAbsolutePath()}=${cm.exists()} and ${f.getAbsolutePath()}=${f.exists()}") + println(s"*** key=$key: ${cm.getAbsolutePath()}=${cm.exists()} and ${f + .getAbsolutePath()}=${f.exists()}") if (cm.exists() && f.exists()) { f.setExecutable(true) Future.successful(f) } else { val p = Promise[File]() val prev = tasks.putIfAbsent(key, p) - println(s"*** t=${this} hc=${key.hashCode} key=$key prev=$prev") if (prev == null) { + println( + s"*** Downloading: t=${this} hc=${key.hashCode} key=${key} prev=$prev" + ) // we are the first val tmpDir = Files.createTempDirectory("protocbridge").toFile doGet(tmpDir, key).map(copyToCache(_, f)).onComplete { diff --git a/protoc-cache-coursier/src/main/scala/protocbridge/ProtocCacheCoursier.scala b/protoc-cache-coursier/src/main/scala/protocbridge/ProtocCacheCoursier.scala index 6f9808f..8072f7f 100644 --- a/protoc-cache-coursier/src/main/scala/protocbridge/ProtocCacheCoursier.scala +++ b/protoc-cache-coursier/src/main/scala/protocbridge/ProtocCacheCoursier.scala @@ -11,7 +11,7 @@ import coursier.core.Extension object CoursierProtocCache { val cache: FileCache[Dependency] = { val x = new FileCache(FileCache.cacheDir, download, filenameFromKey) - println("*** Creating a new filecache: $x") + println(s"*** Creating a new filecache: $x") x }