Skip to content

Commit

Permalink
Merge pull request #76 from Staketab/dev
Browse files Browse the repository at this point in the history
update logic for create task for zkCloud
  • Loading branch information
MrFoxogen authored May 28, 2024
2 parents 69076ac + 56f3215 commit 11fd5e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ public class ZkCloudWorkerScheduler {

private final ZkCloudWorkerService zkCloudWorkerService;

@Scheduled(cron = "${scheduled.zk-cloud-worker.send-task-cron}")
public void sendCreateTask() {
zkCloudWorkerService.sendCreateTask();
}
// @Scheduled(cron = "${scheduled.zk-cloud-worker.send-task-cron}")
// public void sendCreateTask() {
// zkCloudWorkerService.sendCreateTask();
// }

@Scheduled(fixedDelayString = "${scheduled.zk-cloud-worker.check-zk-blocks}")
public void checkBlocksFromZkCloudWorker() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ public void sendTxs(List<PayableTransactionEntity> appliedTxs) {
List<DomainEntity> entities = domainEntities.stream()
.peek(domainEntity -> domainEntity.setIsSendToCloudWorker(true)).toList();

if (!zkCloudWorkerTransactions.isEmpty()) {
sendCreateTask();
}

ZkCloudWorkerDataDTO zkCloudWorkerDataDTO = mapToZkCloudWorkerDataDTO(zkCloudWorkerTransactions, SEND_TRANSACTIONS);
ZkCloudWorkerRequestDTO zkCloudWorkerRequestDTO = mapToZkCloudWorkerRequestDTO(zkCloudWorkerDataDTO, SEND_TRANSACTIONS);
ResponseEntity<String> stringResponseEntity = zkCloudWorkerClient.sendToZkCloudWorker(zkCloudWorkerRequestDTO);
Expand Down

0 comments on commit 11fd5e4

Please sign in to comment.