Fix repository cleanup on tenant deletion

This commit is contained in:
ViacheslavKlimov 2024-06-21 14:15:27 +03:00
parent 656e8458ad
commit e000761fac
3 changed files with 4 additions and 8 deletions

View File

@ -165,7 +165,7 @@ public class DefaultTbClusterService implements TbClusterService {
@Override
public void pushMsgToVersionControl(TenantId tenantId, TransportProtos.ToVersionControlServiceMsg msg, TbQueueCallback callback) {
TopicPartitionInfo tpi = partitionService.resolve(ServiceType.TB_VC_EXECUTOR, tenantId, tenantId);
TopicPartitionInfo tpi = partitionService.resolve(ServiceType.TB_VC_EXECUTOR, TenantId.SYS_TENANT_ID, tenantId);
log.trace("PUSHING msg: {} to:{}", msg, tpi);
producerProvider.getTbVersionControlMsgProducer().send(tpi, new TbProtoQueueMsg<>(tenantId.getId(), msg), callback);
//TODO: ashvayka

View File

@ -526,12 +526,8 @@ public class DefaultEntitiesVersionControlService implements EntitiesVersionCont
}
@Override
public ListenableFuture<Void> deleteVersionControlSettings(TenantId tenantId) throws Exception {
if (repositorySettingsService.delete(tenantId)) {
return gitServiceQueue.clearRepository(tenantId);
} else {
return Futures.immediateFuture(null);
}
public ListenableFuture<Void> deleteVersionControlSettings(TenantId tenantId) {
return gitServiceQueue.clearRepository(tenantId);
}
@Override

View File

@ -65,7 +65,7 @@ public interface EntitiesVersionControlService {
ListenableFuture<RepositorySettings> saveVersionControlSettings(TenantId tenantId, RepositorySettings versionControlSettings);
ListenableFuture<Void> deleteVersionControlSettings(TenantId tenantId) throws Exception;
ListenableFuture<Void> deleteVersionControlSettings(TenantId tenantId);
ListenableFuture<Void> checkVersionControlAccess(TenantId tenantId, RepositorySettings settings) throws Exception;