Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions lib/hexdocs/queue.ex
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,16 @@ defmodule Hexdocs.Queue do

body = Hexdocs.Store.get(:repo_bucket, key)

case type do
:upload ->
process_upload(key, repository, package, version, body, start)
if body do
case type do
:upload ->
process_upload(key, repository, package, version, body, start)

:search ->
process_search(key, repository, package, version, body, start)
:search ->
process_search(key, repository, package, version, body, start)
end
else
Logger.error("#{log_prefix} #{key}: package not found in store")
end

:error ->
Expand Down
5 changes: 2 additions & 3 deletions test/hexdocs/http_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ defmodule Hexdocs.HTTPTest do
end

setup do
port = Enum.random(50_000..60_000)
start_supervised!({Plug.Cowboy, plug: StreamingPlug, scheme: :http, port: port})
{:ok, port: port}
start_supervised!({Plug.Cowboy, plug: StreamingPlug, scheme: :http, port: 0})
{:ok, port: :ranch.get_port(StreamingPlug.HTTP)}
end

describe "get_stream/2" do
Expand Down
4 changes: 2 additions & 2 deletions test/hexdocs/plug_gs_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ defmodule Hexdocs.PlugGSTest do
:ets.delete_all_objects(:mock_gcs_files)

# Start mock GCS server
port = Enum.random(50_000..60_000)
start_supervised!({Plug.Cowboy, plug: MockGCSPlug, scheme: :http, port: port})
start_supervised!({Plug.Cowboy, plug: MockGCSPlug, scheme: :http, port: 0})
port = :ranch.get_port(MockGCSPlug.HTTP)

# Configure to use GS store with mock server
original_store_impl = Application.get_env(:hexdocs, :store_impl)
Expand Down