log.debug("IncrementDownloadCounterBackgroundTask executing with repositoryEntry=" + repositoryEntry);
// this code must not be synchronized because in case of exception we try it again
// this code must not have any error handling or retry, this will be done in super class
if ( RepositoryManager.getInstance().lookupRepositoryEntry(repositoryEntry.getKey()) != null ) {
RepositoryEntry reloadedRe = (RepositoryEntry) DBFactory.getInstance().loadObject(repositoryEntry, true);
reloadedRe.incrementDownloadCounter();
reloadedRe.setLastUsage(new Date());
LifeCycleManager lcManager = LifeCycleManager.createInstanceFor(reloadedRe);
if (lcManager.lookupLifeCycleEntry(RepositoryDeletionManager.SEND_DELETE_EMAIL_ACTION) != null) {
Tracing.logAudit("Repository-Deletion: Remove from delete-list repositoryEntry=" + reloadedRe, RepositoryManager.class);
LifeCycleManager.createInstanceFor(reloadedRe).deleteTimestampFor(RepositoryDeletionManager.SEND_DELETE_EMAIL_ACTION);