fix Sonar critical issue - fix code smells
This commit is contained in:
@ -262,7 +262,7 @@ public class Commander {
|
|||||||
}
|
}
|
||||||
queue.add(qt);
|
queue.add(qt);
|
||||||
queueItems++;
|
queueItems++;
|
||||||
LOG.info(ORDER_ID + ": " + qt.getType() + " task enqueued..", qt.order.id);
|
LOG.info(ORDER_ID + ": {}" + " task enqueued..", qt.order.id, qt.getType());
|
||||||
tryDoingTasksInQueue();
|
tryDoingTasksInQueue();
|
||||||
};
|
};
|
||||||
Retry.HandleErrorIssue<QueueTask> handleError = (qt1, err) -> {
|
Retry.HandleErrorIssue<QueueTask> handleError = (qt1, err) -> {
|
||||||
@ -546,14 +546,14 @@ public class Commander {
|
|||||||
if (queueItems != 0) {
|
if (queueItems != 0) {
|
||||||
var qt = queue.peek(); //this should probably be cloned here
|
var qt = queue.peek(); //this should probably be cloned here
|
||||||
//this is why we have retry for doTasksInQueue
|
//this is why we have retry for doTasksInQueue
|
||||||
LOG.trace(ORDER_ID + ": Started doing task of type " + qt.getType(), qt.order.id);
|
LOG.trace(ORDER_ID + ": Started doing task of type {}", qt.order.id, qt.getType());
|
||||||
if (qt.getFirstAttemptTime() == -1) {
|
if (qt.getFirstAttemptTime() == -1) {
|
||||||
qt.setFirstAttemptTime(System.currentTimeMillis());
|
qt.setFirstAttemptTime(System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
if (System.currentTimeMillis() - qt.getFirstAttemptTime() >= queueTaskTime) {
|
if (System.currentTimeMillis() - qt.getFirstAttemptTime() >= queueTaskTime) {
|
||||||
tryDequeue();
|
tryDequeue();
|
||||||
LOG.trace(ORDER_ID + ": This queue task of type " + qt.getType()
|
LOG.trace(ORDER_ID + ": This queue task of type {}"
|
||||||
+ " does not need to be done anymore (timeout), dequeue..", qt.order.id);
|
+ " does not need to be done anymore (timeout), dequeue..", qt.order.id, qt.getType());
|
||||||
} else {
|
} else {
|
||||||
if (qt.taskType.equals(TaskType.PAYMENT)) {
|
if (qt.taskType.equals(TaskType.PAYMENT)) {
|
||||||
if (!qt.order.paid.equals(PaymentStatus.TRYING)) {
|
if (!qt.order.paid.equals(PaymentStatus.TRYING)) {
|
||||||
|
Reference in New Issue
Block a user