Skip to content

Commit 6c650a8

Browse files
committed
Start HTTP server last
1 parent 32b17d7 commit 6c650a8

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

lib/bob/application.ex

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ defmodule Bob.Application do
22
use Application
33

44
def start(_type, _args) do
5-
opts = [port: port(), compress: true]
6-
75
:logger.add_handler(:sentry_handler, Sentry.LoggerHandler, %{})
86

97
setup_docker()
@@ -14,16 +12,14 @@ defmodule Bob.Application do
1412

1513
File.mkdir_p!(Bob.tmp_dir())
1614

17-
# TODO: Do not start webserver if we are an agent
18-
Plug.Cowboy.http(Bob.Router, [], opts)
19-
2015
children = [
2116
{Task.Supervisor, [name: Bob.Tasks]},
2217
Bob.DockerHub.Auth,
2318
Bob.DockerHub.Cache,
2419
Bob.Queue,
2520
runner_spec(),
26-
{Bob.Schedule, [schedule()]}
21+
{Bob.Schedule, [schedule()]},
22+
{Plug.Cowboy, scheme: :http, plug: Bob.Router, options: [port: port(), compress: true]}
2723
]
2824

2925
opts = [strategy: :one_for_one, name: Bob.Supervisor]

0 commit comments

Comments
 (0)