summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Busby <contact@benbusby.com>2021-12-09 15:33:58 -0700
committerBen Busby <contact@benbusby.com>2021-12-09 15:33:58 -0700
commit1092350fcd3abefe73fc2b2ba429e9ca46e67093 (patch)
tree4dea7fef52ad6334897fec4d933b26d1112f2204 /lib
parentf887ad04007586f230665890ac3e14dd9454eff7 (diff)
downloadfarside-1092350fcd3abefe73fc2b2ba429e9ca46e67093.tar.gz
Remove `FARSIDE_NO_ROUTER` env var
The FARSIDE_NO_ROUTER variable wasn't terribly useful after refactoring the app to include the update routine internally (rather than available externally as an elixir script). Now the only supported environment variable is FARSIDE_TEST, which is still useful for tests and quick validation of functionality.
Diffstat (limited to 'lib')
-rw-r--r--lib/farside/application.ex30
-rw-r--r--lib/farside/instances.ex3
2 files changed, 14 insertions, 19 deletions
diff --git a/lib/farside/application.ex b/lib/farside/application.ex
index 8ccdc58..9fd6e9d 100644
--- a/lib/farside/application.ex
+++ b/lib/farside/application.ex
@@ -7,25 +7,19 @@ defmodule Farside.Application do
@impl true
def start(_type, _args) do
- plug_children =
- (System.get_env("FARSIDE_NO_ROUTER") && []) ||
- [
- Plug.Cowboy.child_spec(
- scheme: :http,
- plug: Farside.Router,
- options: [
- port: @farside_port
- ]
- ),
- {PlugAttack.Storage.Ets, name: Farside.Throttle.Storage, clean_period: 60_000}
+ children = [
+ Plug.Cowboy.child_spec(
+ scheme: :http,
+ plug: Farside.Router,
+ options: [
+ port: @farside_port
]
-
- children =
- [
- {Redix, {@redis_conn, [name: :redix]}},
- Farside.Scheduler,
- Farside.Server
- ] ++ plug_children
+ ),
+ {PlugAttack.Storage.Ets, name: Farside.Throttle.Storage, clean_period: 60_000},
+ {Redix, {@redis_conn, [name: :redix]}},
+ Farside.Scheduler,
+ Farside.Server
+ ]
opts = [strategy: :one_for_one, name: Farside.Supervisor]
Supervisor.start_link(children, opts)
diff --git a/lib/farside/instances.ex b/lib/farside/instances.ex
index c8e7611..0e1b9b4 100644
--- a/lib/farside/instances.ex
+++ b/lib/farside/instances.ex
@@ -45,7 +45,8 @@ defmodule Farside.Instances do
result =
Enum.filter(service.instances, fn instance_url ->
- request_url = instance_url <>
+ request_url =
+ instance_url <>
EEx.eval_string(
service.test_url,
query: Enum.random(@queries)