Skip to content

Commit

Permalink
Do resource cleanup only if resources have to be updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
Giedrius Zavadskis committed Mar 31, 2021
1 parent 515ed2e commit 37fed05
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,13 @@ protected void getdown ()
if (_app.verifyMetadata(this)) {
log.info("Application requires update.");
update();

// do resource cleanup
final List<String> cleanupPatterns = _app.cleanupPatterns();
if (!cleanupPatterns.isEmpty()) {
cleanupResources(cleanupPatterns);
}

// loop back again and reverify the metadata
continue;
}
Expand Down Expand Up @@ -425,12 +432,6 @@ protected void getdown ()
_readyToInstall = true;
install();

// do resource cleanup
final List<String> cleanupPatterns = _app.cleanupPatterns();
if (!cleanupPatterns.isEmpty()) {
cleanupResources(cleanupPatterns);
}

// Only launch if we aren't in silent mode. Some mystery program starting out
// of the blue would be disconcerting.
if (!_silent || _launchInSilent) {
Expand Down

0 comments on commit 37fed05

Please sign in to comment.