Skip to content

Commit

Permalink
fix dialyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
filipecabaco committed Nov 19, 2024
1 parent ca150a2 commit 947f820
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/realtime/database.ex
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,12 @@ defmodule Realtime.Database do
@doc """
Runs database transaction in local node or against a target node withing a Postgrex transaction
"""
@spec transaction(pid, fun(), keyword()) :: {:ok, any()} | {:error, any()}
@spec transaction(pid | DBConnection.t(), fun(), keyword()) :: {:ok, any()} | {:error, any()}
def transaction(db_conn, func, opts \\ [], metadata \\ [])

def transaction(%DBConnection{} = db_conn, func, opts, metadata),
do: transaction_catched(db_conn, func, opts, metadata)

def transaction(db_conn, func, opts, metadata) when node() == node(db_conn),
do: transaction_catched(db_conn, func, opts, metadata)

Expand Down

0 comments on commit 947f820

Please sign in to comment.