Mark account as cleanup_required=0 when cleanup was finished successfully

This commit is contained in:
alena 2011-08-30 14:08:35 -07:00
parent 8f9b929e3f
commit d65bef383c
1 changed files with 5 additions and 1 deletions

View File

@ -1851,7 +1851,10 @@ public class AccountManagerImpl implements AccountManager, AccountService, Manag
for (AccountVO account : removedAccounts) {
s_logger.debug("Cleaning up " + account.getId());
try {
cleanupAccount(account, getSystemUser().getId(), getSystemAccount());
if (cleanupAccount(account, getSystemUser().getId(), getSystemAccount())) {
account.setNeedsCleanup(false);
_accountDao.update(account.getId(), account);
}
} catch (Exception e) {
s_logger.error("Skipping due to error on account " + account.getId(), e);
}
@ -1874,6 +1877,7 @@ public class AccountManagerImpl implements AccountManager, AccountService, Manag
//cleanup inactive domains
List<DomainVO> inactiveDomains = _domainDao.findInactiveDomains();
s_logger.info("Found " + inactiveDomains.size() + " inactive domains to cleanup");
for (DomainVO inactiveDomain : inactiveDomains) {
long domainId = inactiveDomain.getId();
try {