We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ordertaskscheduler causes a high database load every 30 minutes. The findall method call iterates over the entire database:
@Scheduled(fixedRate = CLEAN_UP_TASK_INTERVAL_SECONDS * MILLISEC_IN_SEC) public void cleanUpTask() { orderService.getAllOrders().forEach(order -> { if (order.getCreatedAt().isBefore(LocalDateTime.now().minusMinutes(CLEAN_UP_INTERVAL))) { OrderStatus[] cleanUpStatus = new OrderStatus[]{OrderStatus.ANONYMOUS, OrderStatus.ASSIGNED}; if (ArrayUtils.contains(cleanUpStatus, order.getStatus())) { log.info("Order " + order.getPublicReference() + ": Order has been deleted!"); orderService.delete(order); } } }); } ```
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Ordertaskscheduler causes a high database load every 30 minutes. The findall method call iterates over the entire database:
The text was updated successfully, but these errors were encountered: