Added errors handling to the try_multi_step

This commit is contained in:
Alex Golubov
2018-07-12 15:31:56 +05:00
parent f5d73f7c82
commit ad1f9b83c5

View File

@@ -220,8 +220,11 @@ try_multi_step(Statement, ChunkSize, Rest, Tries) ->
erlang:display({"busy", Tries}), erlang:display({"busy", Tries}),
timer:sleep(100 * Tries), timer:sleep(100 * Tries),
try_multi_step(Statement, ChunkSize, Rows ++ Rest, Tries + 1); try_multi_step(Statement, ChunkSize, Rows ++ Rest, Tries + 1);
{Status, Rows} -> {rows, Rows} ->
{Status, Rows ++ Rest} {rows, Rows ++ Rest};
{'$done', Rows} ->
{'$done', Rows ++ Rest};
Else -> Else
end. end.
%% @doc Execute Sql statement, returns the number of affected rows. %% @doc Execute Sql statement, returns the number of affected rows.