Skip to content

New routing 2#201

Open
WWWcool wants to merge 7 commits into
masterfrom
tmp_routing_2
Open

New routing 2#201
WWWcool wants to merge 7 commits into
masterfrom
tmp_routing_2

Conversation

@WWWcool
Copy link
Copy Markdown
Contributor

@WWWcool WWWcool commented Mar 26, 2026

No description provided.

Comment thread apps/routing/src/hg_route_fd.erl Outdated
Comment thread apps/routing/src/hg_route.erl Outdated
Comment thread apps/hellgate/src/hg_invoice_payment.erl
Comment thread apps/hellgate/src/hg_inspector.erl
Comment thread apps/hellgate/src/hg_invoice_payment.erl
[] ->
ok = log_rejected_route_groups(FilterResult, VS),
handle_filtered_routes_exhaustion(FilterResult, Revision, St, Action);
FilteredRoutes ->
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут пропускается log_rejected_route_groups/2. Раньше мы в любом случае получали это в логи.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Зачем ты это удалил?) Я о том что в FilteredRoutes матчинг этот лог тоже можно добавить.

Comment thread apps/hellgate/src/hg_party.erl
Comment thread apps/hellgate/test/hg_invoice_lite_tests_SUITE.erl
Comment on lines 763 to 764
log_rejected_routes(in_blacklist, Routes, _VS) ->
?LOG_MD(notice, "Route candidates are blacklisted: ~p", [Routes]);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ты удалил его, теперь не летит is_blacklist

Comment on lines -2044 to -2045
construct_routing_failure(Error) when is_atom(Error) ->
construct_routing_failure([{unknown_error, Error}], undefined).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Мы теперь будем тут ловить 500ку, может не надо?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

вроде бы таких код пасов нет, так что и попадать сюда не должно

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ну это не важно, это защита "на всякий случай", чтобы даже если кто-то в будущем что-то добавил и при этом не указал в этом списке у нас не рушился просто роутинг весь.

fill_blacklist(_BlCtx, []) ->
[];
fill_blacklist(BlCtx, Routes) ->
[hg_inspector:fill_blacklist(R, BlCtx) || R <- Routes].
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут мы делаем цепной запрос в Inspector, может сделаем его параллельным?

-spec from_payment_route(revision(), payment_route()) -> t().
from_payment_route(Revision, Route) ->
?route(ProviderRef, TerminalRef) = Route,
new(Revision, ProviderRef, TerminalRef, 0, 1000, undefined).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вынеси в макрос, пожалуйста

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

что именно?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Значения 0 и 1000. Они стандартизированы и от них зависит роутинг, потому я хотел бы видеть их в виде макросов

-export([fill_accepted/4]).
-export([get_routes/4]).

-callback fill(_Params, [hg_route:t()]) -> [hg_route:t()].
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Этот колбек никто не реализует.

card_token => card_token() | undefined
}.

-type get_routes_resut() :: #{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-type get_routes_resut() :: #{
-type get_routes_result() :: #{

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants