Do resource cleanup only if resources have to be updated.

(cherry picked from commit 37fed0570e1eb3ac520256761760a8e311889b51)
This commit is contained in:
Giedrius Zavadskis
2021-03-31 10:29:44 +03:00
parent 79420067b2
commit 332f7f15e3
@@ -343,6 +343,13 @@ public abstract class Getdown
if (_app.verifyMetadata(this)) { if (_app.verifyMetadata(this)) {
log.info("Application requires update."); log.info("Application requires update.");
update(); update();
// do resource cleanup
final List<String> cleanupPatterns = _app.cleanupPatterns();
if (!cleanupPatterns.isEmpty()) {
cleanupResources(cleanupPatterns);
}
// loop back again and reverify the metadata // loop back again and reverify the metadata
continue; continue;
} }
@@ -425,12 +432,6 @@ public abstract class Getdown
_readyToInstall = true; _readyToInstall = true;
install(); 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 // Only launch if we aren't in silent mode. Some mystery program starting out
// of the blue would be disconcerting. // of the blue would be disconcerting.
if (!_silent || _launchInSilent) { if (!_silent || _launchInSilent) {