Skip to content

Commit

Permalink
Update uploadfile.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
masx200 authored Sep 18, 2020
1 parent f5c4fe9 commit 5f028b5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/uploadfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,19 @@ export async function uploadandcheck(

const inputbase = path.basename(file);
const remotefile = posix.join(destination, inputbase);
const fileexist = await checkexist(remotefile);
const starttime=Date.now()
const fileexist = await checkexist(remotefile);
if (fileexist) {
console.log(
"检查网盘中存在此文件,上传文件成功:" + file + " " + remotefile
["检查网盘中存在此文件,上传文件成功:" , file , remotefile].join("\n")
);
const endtime=Date.now()
const durtime=(endtime-starttime)/1000
console.log("用时"+durtime+"秒")
return;
} else {
console.warn(
"检查网盘中不存在此文件,重新上传文件:" + file + " " + remotefile
["检查网盘中不存在此文件,重新上传文件:" , file , remotefile].join("\n")
);
return await retryupload(file, destination);
}
Expand Down

0 comments on commit 5f028b5

Please sign in to comment.