Jps caches: fixed logging for already uploaded resources
authorDmitriy.Panov <Dmitriy.Panov@jetbrains.com>
Thu, 13 Aug 2020 11:32:18 +0000 (14:32 +0300)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Thu, 13 Aug 2020 12:37:24 +0000 (12:37 +0000)
GitOrigin-RevId: 8b7c7821b9d0dd92ce624c37982bc4c671a1db33

platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/compilation/CompilationOutputsUploader.groovy

index c17b3578f26986dcef252656ed46efc59dcc13cd..6ea127c829f895edbd21941561c34fd9af85e302 100644 (file)
@@ -99,7 +99,7 @@ class CompilationOutputsUploader {
   private void uploadCompilationCache() {
     File zipFile = buildCompilationCacheZip()
     String cachePath = "caches/$commitHash"
-    if (!uploader.isExist(cachePath)) {
+    if (!uploader.isExist(cachePath, true)) {
       uploader.upload(cachePath, zipFile)
     }
     File zipCopy = new File(syncFolder, cachePath)
@@ -129,7 +129,7 @@ class CompilationOutputsUploader {
       def outputFolder = new File(compilationOutput.path)
       File zipFile = new File(outputFolder.getParent(), compilationOutput.hash)
       zipBinaryData(zipFile, outputFolder)
-      if (!uploader.isExist(sourcePath, false)) {
+      if (!uploader.isExist(sourcePath)) {
         uploader.upload(sourcePath, zipFile)
         uploadedOutputsCount.incrementAndGet()
       }
@@ -172,7 +172,7 @@ class CompilationOutputsUploader {
   }
 
   CommitsHistory remoteCommitHistory() {
-    if (uploader.isExist(CommitsHistory.JSON_FILE, false)) {
+    if (uploader.isExist(CommitsHistory.JSON_FILE)) {
       def json = uploader.getAsString(CommitsHistory.JSON_FILE)
       new CommitsHistory(json)
     }
@@ -200,11 +200,11 @@ class CompilationOutputsUploader {
       super(serverUrl, messages)
     }
 
-    boolean isExist(@NotNull final String path, boolean logIfExists = true) {
+    boolean isExist(@NotNull final String path, boolean logIfExists = false) {
       int code = doHead(path)
       if (code == 200) {
         if (logIfExists) {
-          log("File '$path' already exist on server, nothing to upload")
+          log("File '$path' already exists on server, nothing to upload")
         }
         return true
       }