mirror of
https://github.com/valitydev/party-management.git
synced 2024-11-06 01:05:21 +00:00
TD-621: add logging for rejected routes (#32)
* TD-621: add logging for rejected routes * TD-621: fix issue --------- Co-authored-by: anatoliy.losev <losto@nix>
This commit is contained in:
parent
6a6118caa5
commit
9150bc3545
1
.gitignore
vendored
1
.gitignore
vendored
@ -11,6 +11,7 @@ rebar3.crashdump
|
||||
/.idea/
|
||||
*.beam
|
||||
tags
|
||||
*.iml
|
||||
|
||||
# make stuff
|
||||
/.image.*
|
||||
|
@ -15,6 +15,12 @@
|
||||
-spec reduce_payment_routing_ruleset(payment_routing_ruleset(), varset(), domain_revision()) ->
|
||||
payment_routing_ruleset().
|
||||
reduce_payment_routing_ruleset(RuleSet, VS, DomainRevision) ->
|
||||
logger:log(
|
||||
info,
|
||||
"Routing start reduce ruleset with varset: ~p",
|
||||
[VS],
|
||||
logger:get_process_metadata()
|
||||
),
|
||||
RuleSet#domain_RoutingRuleset{
|
||||
decisions = reduce_payment_routing_decisions(RuleSet#domain_RoutingRuleset.decisions, VS, DomainRevision)
|
||||
}.
|
||||
@ -31,6 +37,12 @@ reduce_payment_routing_delegates([D | Delegates], VS, Rev) ->
|
||||
RuleSetRef = D#domain_RoutingDelegate.ruleset,
|
||||
case pm_selector:reduce_predicate(Predicate, VS, Rev) of
|
||||
?const(false) ->
|
||||
logger:log(
|
||||
info,
|
||||
"Routing delegate rejected. Delegate: ~p~nPredicate: ~p",
|
||||
[D, Predicate],
|
||||
logger:get_process_metadata()
|
||||
),
|
||||
reduce_payment_routing_delegates(Delegates, VS, Rev);
|
||||
?const(true) ->
|
||||
#domain_RoutingRuleset{
|
||||
@ -52,6 +64,12 @@ reduce_payment_routing_candidates(Candidates, VS, Rev) ->
|
||||
Predicate = C#domain_RoutingCandidate.allowed,
|
||||
case pm_selector:reduce_predicate(Predicate, VS, Rev) of
|
||||
?const(false) ->
|
||||
logger:log(
|
||||
info,
|
||||
"Routing candidate rejected. Candidate: ~p~nPredicate: ~p",
|
||||
[C, Predicate],
|
||||
logger:get_process_metadata()
|
||||
),
|
||||
AccIn;
|
||||
?const(true) = ReducedPredicate ->
|
||||
ReducedCandidate = C#domain_RoutingCandidate{
|
||||
|
Loading…
Reference in New Issue
Block a user