Skip to content

Commit

Permalink
improvement on sync kraken version
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiyaoPCCW committed Nov 19, 2024
1 parent 4747a4b commit ee5cb1f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.consoleconnect.kraken.operator.core.enums.MgmtEventType;
import com.consoleconnect.kraken.operator.core.repo.MgmtEventRepository;
import com.consoleconnect.kraken.operator.core.repo.SystemInfoRepository;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
Expand All @@ -29,8 +28,8 @@ public void runIt() {
.ifPresent(
systemInfoEntity -> {
Page<MgmtEventEntity> mgmtEventEntities =
mgmtEventRepository.findByEventTypeInAndStatus(
List.of(MgmtEventType.CLIENT_SYSTEM_INFO.name()), null, Pageable.ofSize(1));
mgmtEventRepository.search(
MgmtEventType.CLIENT_SYSTEM_INFO.name(), null, Pageable.ofSize(1));
if (CollectionUtils.isEmpty(mgmtEventEntities.getContent())) {
MgmtEventEntity entity = new MgmtEventEntity();
entity.setStatus(EventStatusType.WAIT_TO_SEND.name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ void givenSystemInfoEvent_whenRun_thenPushSuccessfully() {
systemInfoRepository.save(entity);
// when
pushKrakenVersionService.runIt();
entity.setStageAppVersion("2.0.0");
systemInfoRepository.save(entity);
pushKrakenVersionService.runIt();
// then
Page<MgmtEventEntity> eventEntities =
mgmtEventRepository.findByEventTypeInAndStatus(
Expand Down

0 comments on commit ee5cb1f

Please sign in to comment.