Skip to content

Commit

Permalink
[Improve] code minor optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
benjobs committed Nov 10, 2023
1 parent 698b801 commit a69dc84
Showing 1 changed file with 3 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -402,21 +402,10 @@ private void prepareJars(Application app) throws IOException {
checkOrElseUploadJar(localFS, localJar, localUploadJar, localUploadDIR);

// 2) copy jar to local $app_home/lib
boolean cleanUpload = false;
File libJar = new File(app.getLocalAppLib(), app.getJar());
if (!localFS.exists(app.getLocalAppLib())) {
cleanUpload = true;
} else {
if (libJar.exists()) {
if (!FileUtils.equals(localJar, libJar)) {
cleanUpload = true;
}
} else {
cleanUpload = true;
}
}

if (cleanUpload) {
if (!localFS.exists(app.getLocalAppLib())
|| !libJar.exists()
|| !FileUtils.equals(localJar, libJar)) {
localFS.mkCleanDirs(app.getLocalAppLib());
localFS.upload(localUploadJar.getAbsolutePath(), app.getLocalAppLib());
}
Expand Down

0 comments on commit a69dc84

Please sign in to comment.