elviss 2 жил өмнө
parent
commit
b3c343dd98
1 өөрчлөгдсөн 5 нэмэгдсэн , 5 устгасан
  1. 5 5
      src/Utility.php

+ 5 - 5
src/Utility.php

@@ -314,13 +314,13 @@ function loadConfig($cfgPath){
 
 //检测文件是否需要下载
 function isFileCached($filePath,$fileMd5,$fileSize){
-	if( file_exists($targetPath) ) {
-		return true;
+	if(! file_exists($filePath) ) {
+		return false;
 	}
-	if( filesize($targetPath) == $fileSize){
-		return true;
+	if( filesize($filePath) != $fileSize){
+		return false;
 	}
-	return false;
+	return true;
 }
 //多线程下载文件
 function downloadToDir($toolDir,$downClient,$ossHost,$repoName,$fileName,$fileMd5,$fileSize,$targetDir){