summaryrefslogtreecommitdiff
path: root/update.exs
diff options
context:
space:
mode:
authorBen Busby <noreply+git@benbusby.com>2021-11-09 15:12:58 -0700
committerBen Busby <noreply+git@benbusby.com>2021-11-09 15:12:58 -0700
commit39c244d970d802e6ee2853cfbb5f73b8c06a2fdc (patch)
tree11024b96cc206bbe7984b5a056ee053cf6e8a0b8 /update.exs
parent1908c56ec62257ce64838b20df9fa31fc40eb157 (diff)
downloadfarside-39c244d970d802e6ee2853cfbb5f73b8c06a2fdc.tar.gz
Skip querying all instances w/ "test mode"
Now allows setting FARSIDE_TEST to skip individually fetching each instance, and instead just adds all of them to redis instantly. This allows for an easier time in CI builds, for both the sake of speed and to prevent a scenario where many simultaneous builds have a noticeable impact on actual instances.
Diffstat (limited to 'update.exs')
-rw-r--r--update.exs15
1 files changed, 10 insertions, 5 deletions
diff --git a/update.exs b/update.exs
index 4e95392..d89ffa8 100644
--- a/update.exs
+++ b/update.exs
@@ -19,12 +19,17 @@ defmodule Instances do
end
def request(url) do
- case HTTPoison.get(url) do
- {:ok, %HTTPoison.Response{status_code: 200}} ->
- # TODO: Add validation of results, not just status code
+ cond do
+ System.get_env("FARSIDE_TEST") ->
:good
- _ ->
- :bad
+ true ->
+ case HTTPoison.get(url) do
+ {:ok, %HTTPoison.Response{status_code: 200}} ->
+ # TODO: Add validation of results, not just status code
+ :good
+ _ ->
+ :bad
+ end
end
end