Browse Source

Fix repository cleanup on tenant deletion

pull/11084/head
ViacheslavKlimov 2 years ago
parent
commit
e000761fac
  1. 2
      application/src/main/java/org/thingsboard/server/service/queue/DefaultTbClusterService.java
  2. 8
      application/src/main/java/org/thingsboard/server/service/sync/vc/DefaultEntitiesVersionControlService.java
  3. 2
      application/src/main/java/org/thingsboard/server/service/sync/vc/EntitiesVersionControlService.java

2
application/src/main/java/org/thingsboard/server/service/queue/DefaultTbClusterService.java

@ -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

8
application/src/main/java/org/thingsboard/server/service/sync/vc/DefaultEntitiesVersionControlService.java

@ -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

2
application/src/main/java/org/thingsboard/server/service/sync/vc/EntitiesVersionControlService.java

@ -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;

Loading…
Cancel
Save