Skip to content

Commit

Permalink
Credo changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Karthiksrinatha committed Sep 24, 2024
1 parent 514cf4d commit 8a31b89
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/refiner/ipfs/ipfs_interactor.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ defmodule Refiner.IPFSInteractor do
alias Multipart.Part
alias Refiner.Events

# Define the IPFS base URL from application config
@ipfs_base_url Application.get_env(:refiner, :ipfs_pinner_url)

plug(Tesla.Middleware.BaseUrl, @ipfs_base_url)
plug(Tesla.Middleware.JSON)

require Logger
Expand All @@ -33,6 +29,7 @@ defmodule Refiner.IPFSInteractor do
@impl true
def handle_call({:pin, file_path}, _from, state) do
start_pin_ms = System.monotonic_time(:millisecond)
ipfs_url = Application.get_env(:refiner, :ipfs_pinner_url)

# Create a multipart request
multipart =
Expand All @@ -44,7 +41,7 @@ defmodule Refiner.IPFSInteractor do
]
)

case post("/upload", multipart) do
case post("#{ipfs_url}/upload", multipart) do
{:ok, %Tesla.Env{body: body, headers: _, status: _}} ->
body_map = body |> Poison.decode!()

Expand Down

0 comments on commit 8a31b89

Please sign in to comment.