Skip to content
Draft
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
9 changes: 3 additions & 6 deletions .formatter.exs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
[
inputs: [
"*.exs",
"config/*.exs",
"lib/**/*.ex",
"test/**/*.{ex,exs}"
]
inputs:
["*.exs", "config/*.exs", "test/**/*.{ex,exs}"] ++
(Path.wildcard("lib/**/*.ex") -- Path.wildcard("lib/hex/mint/**/*.ex"))
]
16 changes: 2 additions & 14 deletions lib/hex/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ defmodule Hex.Application do
Mix.SCM.append(Hex.SCM)
Mix.RemoteConverger.register(Hex.RemoteConverger)

start_httpc()

opts = [strategy: :one_for_one, name: Hex.Supervisor]
Supervisor.start_link(children(), opts)
end
Expand All @@ -33,25 +31,14 @@ defmodule Hex.Application do
defp dev_setup, do: :ok
end

defp start_httpc() do
:inets.start(:httpc, profile: :hex)

opts = [
max_sessions: 8,
max_keep_alive_length: 4,
keep_alive_timeout: 120_000
]

:httpc.set_options(opts, :hex)
end

if Mix.env() == :test do
defp children do
[
Hex.Netrc.Cache,
Hex.OAuth,
Hex.Repo,
Hex.State,
Hex.HTTP.Pool,
Hex.Server,
{Hex.Parallel, [:hex_fetcher]}
]
Expand All @@ -63,6 +50,7 @@ defmodule Hex.Application do
Hex.OAuth,
Hex.Repo,
Hex.State,
Hex.HTTP.Pool,
Hex.Server,
{Hex.Parallel, [:hex_fetcher]},
Hex.Registry.Server,
Expand Down
Loading
Loading