mirror of
https://github.com/valitydev/fistful-server.git
synced 2024-11-06 02:35:18 +00:00
TD-366: Make session finalization idempotent (#42)
This commit is contained in:
parent
0b993f44a6
commit
e28ecaa408
2
.env
2
.env
@ -2,6 +2,6 @@
|
|||||||
# You SHOULD specify point releases here so that build time and run time Erlang/OTPs
|
# You SHOULD specify point releases here so that build time and run time Erlang/OTPs
|
||||||
# are the same. See: https://github.com/erlware/relx/pull/902
|
# are the same. See: https://github.com/erlware/relx/pull/902
|
||||||
SERVICE_NAME=fistful-server
|
SERVICE_NAME=fistful-server
|
||||||
OTP_VERSION=24.2.0
|
OTP_VERSION=24.3
|
||||||
REBAR_VERSION=3.18
|
REBAR_VERSION=3.18
|
||||||
THRIFT_VERSION=0.14.2.3
|
THRIFT_VERSION=0.14.2.3
|
||||||
|
@ -972,9 +972,11 @@ create_session(ID, TransferData, SessionParams) ->
|
|||||||
-spec finalize_session(session_id(), session_result(), withdrawal_state()) ->
|
-spec finalize_session(session_id(), session_result(), withdrawal_state()) ->
|
||||||
{ok, process_result()} | {error, finalize_session_error()}.
|
{ok, process_result()} | {error, finalize_session_error()}.
|
||||||
finalize_session(SessionID, Result, Withdrawal) ->
|
finalize_session(SessionID, Result, Withdrawal) ->
|
||||||
case session_id(Withdrawal) of
|
case {session_id(Withdrawal), get_current_session_status(Withdrawal)} of
|
||||||
SessionID ->
|
{SessionID, pending} ->
|
||||||
{ok, {continue, [{session_finished, {SessionID, Result}}]}};
|
{ok, {continue, [{session_finished, {SessionID, Result}}]}};
|
||||||
|
{SessionID, _} ->
|
||||||
|
{ok, {undefined, []}};
|
||||||
_OtherSessionID ->
|
_OtherSessionID ->
|
||||||
{error, {wrong_session_id, SessionID}}
|
{error, {wrong_session_id, SessionID}}
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user