1
0
Fork 0
mirror of https://github.com/benbusby/farside.git synced 2025-04-30 15:40:02 +00:00

Add env var for toggling cron task on/off

FARSIDE_CRON allows turning on/off the scheduled instance availability
check that occurs every 5 minutes by setting the variable to 1 (on) or 0
(off). The default behavior is "on".
This commit is contained in:
Ben Busby 2023-07-17 17:46:39 -06:00
parent 9104650cfe
commit 7693a6b063
No known key found for this signature in database
GPG key ID: B9B7231E01D924A1
2 changed files with 10 additions and 3 deletions

View file

@ -7,7 +7,10 @@ defmodule Farside.Server do
end
def start_link(arg) do
if System.get_env("FARSIDE_TEST") do
test = System.get_env("FARSIDE_TEST")
cron = System.get_env("FARSIDE_CRON")
if test == "1" || cron == "0" do
IO.puts("Skipping sync job setup...")
else
Farside.Scheduler.new_job()