Skip to content

Commit

Permalink
feat: Use github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
zookzook committed Mar 20, 2022
1 parent 9510055 commit 90f9ab8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
4 changes: 3 additions & 1 deletion lib/mongo/session.ex
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,9 @@ defmodule Mongo.Session do
|> filter_nils()

case Mongo.exec_command(conn, cmd, database: "admin") do
{:ok, _doc} -> :ok
{:ok, _doc} ->
:ok

{:error, error} ->
timeout = opts[:transaction_retry_timeout_s] || @retry_timeout_seconds
try_again = Error.has_label(error, "UnknownTransactionCommitResult") && DateTime.diff(DateTime.utc_now(), time, :second) < timeout
Expand Down
6 changes: 4 additions & 2 deletions lib/mongo/topology.ex
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,11 @@ defmodule Mongo.Topology do
{:ok, {address, _opts}} ->
case get_connection(address, state) do
{:ok, connection} ->
{:reply, {:ok, connection}, state}
{:reply, {:ok, connection}, state}

## in case of an error, just return the error
error -> {:reply, error, state}
error ->
{:reply, error, state}
end

## in case of an error, just return the error
Expand Down
4 changes: 2 additions & 2 deletions test/bson_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ defmodule BSONTest do
@bin_3 <<32, 0, 0, 0, 3, 97, 0, 24, 0, 0, 0, 3, 98, 0, 5, 0, 0, 0, 0, 3, 99, 0, 8, 0, 0, 0, 10, 100, 0, 0, 0, 0>>

@map_4 %{"a" => [], "b" => [1, 2, 3], "c" => [1.1, "2", true]}
@bin_4 <<74, 0, 0, 0, 4, 97, 0, 5, 0, 0, 0, 0, 4, 98, 0, 26, 0, 0, 0, 16, 48, 0, 1, 0, 0, 0, 16, 49, 0, 2, 0, 0, 0, 16, 50, 0, 3, 0, 0, 0, 0, 4, 99, 0, 29, 0, 0, 0, 1, 48, 0, 154, 153, 153, 153, 153, 153, 241, 63, 2, 49, 0, 2, 0, 0, 0, 50, 0, 8, 50,
0, 1, 0, 0>>
@bin_4 <<74, 0, 0, 0, 4, 97, 0, 5, 0, 0, 0, 0, 4, 98, 0, 26, 0, 0, 0, 16, 48, 0, 1, 0, 0, 0, 16, 49, 0, 2, 0, 0, 0, 16, 50, 0, 3, 0, 0, 0, 0, 4, 99, 0, 29, 0, 0, 0, 1, 48, 0, 154, 153, 153, 153, 153, 153, 241, 63, 2, 49, 0, 2, 0, 0, 0, 50, 0, 8,
50, 0, 1, 0, 0>>

@map_5 %{"a" => 123.0}
@bin_5 <<16, 0, 0, 0, 1, 97, 0, 0, 0, 0, 0, 0, 192, 94, 64, 0>>
Expand Down
3 changes: 2 additions & 1 deletion test/support/test_connection.ex
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
defmodule Mongo.TestConnection do
@moduledoc false

@seeds ["127.0.0.1:27017"] ## todo , "127.0.0.1:27018", "127.0.0.1:27019"]
## todo , "127.0.0.1:27018", "127.0.0.1:27019"]
@seeds ["127.0.0.1:27017"]

def connect() do
Mongo.start_link(database: "mongodb_test", seeds: @seeds, show_sensitive_data_on_connection_error: true)
Expand Down

0 comments on commit 90f9ab8

Please sign in to comment.