Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArtifactRepository made optional for JpaSystemManagement #2019

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public class JpaSystemManagement implements CurrentTenantCacheKeyGenerator, Syst
private PlatformTransactionManager txManager;
@Autowired
private RolloutStatusCache rolloutStatusCache;
@Autowired
@Autowired(required = false) // it's not required on dmf/ddi only instances
private ArtifactRepository artifactRepository;
@Autowired
private RepositoryProperties repositoryProperties;
Expand Down Expand Up @@ -156,6 +156,10 @@ public String currentTenant() {
@Retryable(include = {
ConcurrencyFailureException.class }, maxAttempts = Constants.TX_RT_MAX, backoff = @Backoff(delay = Constants.TX_RT_DELAY))
public void deleteTenant(final String t) {
if (artifactRepository == null) {
throw new IllegalStateException("Artifact repository is not available. Can't delete tenant.");
}

final String tenant = t.toUpperCase();
cacheManager.evictCaches(tenant);
rolloutStatusCache.evictCaches(tenant);
Expand Down
Loading