1.30 k8s pods查询
This commit is contained in:
parent
bd1f7fe89e
commit
c440a91782
@ -10,6 +10,8 @@ import com.qqchen.deploy.backend.framework.service.impl.BaseServiceImpl;
|
|||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Propagation;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -24,6 +26,26 @@ public class K8sSyncHistoryServiceImpl extends BaseServiceImpl<K8sSyncHistory, K
|
|||||||
@Resource
|
@Resource
|
||||||
private K8sSyncHistoryConverter k8sSyncHistoryConverter;
|
private K8sSyncHistoryConverter k8sSyncHistoryConverter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重写create方法,确保在异步虚拟线程环境下使用独立的读写事务
|
||||||
|
* REQUIRES_NEW: 强制创建新事务,不受外层只读事务影响
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = false, rollbackFor = Exception.class)
|
||||||
|
public K8sSyncHistoryDTO create(K8sSyncHistoryDTO dto) {
|
||||||
|
return super.create(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重写update方法,确保在异步虚拟线程环境下使用独立的读写事务
|
||||||
|
* REQUIRES_NEW: 强制创建新事务,不受外层只读事务影响
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = false, rollbackFor = Exception.class)
|
||||||
|
public K8sSyncHistoryDTO update(Long id, K8sSyncHistoryDTO dto) {
|
||||||
|
return super.update(id, dto);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<K8sSyncHistoryDTO> findByExternalSystemId(Long externalSystemId) {
|
public List<K8sSyncHistoryDTO> findByExternalSystemId(Long externalSystemId) {
|
||||||
List<K8sSyncHistory> histories = k8sSyncHistoryRepository.findByExternalSystemIdOrderByCreateTimeDesc(externalSystemId);
|
List<K8sSyncHistory> histories = k8sSyncHistoryRepository.findByExternalSystemIdOrderByCreateTimeDesc(externalSystemId);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user