Skip to content

Commit

Permalink
fix(core): multiple condition log should not be sent on the database
Browse files Browse the repository at this point in the history
  • Loading branch information
tchiotludo committed May 15, 2023
1 parent 4ebc76a commit 46e1e57
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import io.kestra.core.models.triggers.multipleflows.MultipleConditionStorageInterface;
import io.kestra.core.models.triggers.multipleflows.MultipleConditionWindow;
import io.kestra.core.services.FlowService;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;

import java.time.Duration;
Expand Down Expand Up @@ -71,6 +72,7 @@
)
}
)
@Slf4j
public class MultipleCondition extends Condition {
@NotNull
@NotBlank
Expand Down Expand Up @@ -119,8 +121,6 @@ public class MultipleCondition extends Condition {
*/
@Override
public boolean test(ConditionContext conditionContext) throws InternalException {
Logger logger = conditionContext.getRunContext().logger();

MultipleConditionStorageInterface multipleConditionStorage = conditionContext.getMultipleConditionStorage();
Objects.requireNonNull(multipleConditionStorage);

Expand All @@ -147,14 +147,14 @@ public boolean test(ConditionContext conditionContext) throws InternalException

boolean result = conditions.size() == validatedCount;

if (result && logger.isDebugEnabled()) {
logger.debug(
if (result && log.isDebugEnabled()) {
log.debug(
"[namespace: {}] [flow: {}] Multiple conditions validated !",
conditionContext.getFlow().getNamespace(),
conditionContext.getFlow().getId()
);
} else if (logger.isTraceEnabled()) {
logger.trace(
} else if (log.isTraceEnabled()) {
log.trace(
"[namespace: {}] [flow: {}] Multiple conditions failed ({}/{}) with '{}'",
conditionContext.getFlow().getNamespace(),
conditionContext.getFlow().getId(),
Expand Down

0 comments on commit 46e1e57

Please sign in to comment.