Skip to content

Commit

Permalink
move the enabling of the schedule to a app env var
Browse files Browse the repository at this point in the history
  • Loading branch information
brianflanagan committed Jan 14, 2025
1 parent 11c3306 commit 6f06ae2
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 3 deletions.
3 changes: 2 additions & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import Config

config :ppr_api,
ecto_repos: [PprApi.Repo],
generators: [timestamp_type: :utc_datetime]
generators: [timestamp_type: :utc_datetime],
scheduler_enabled: true

# Configures the endpoint
config :ppr_api, PprApiWeb.Endpoint,
Expand Down
3 changes: 3 additions & 0 deletions config/test.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import Config

config :ppr_api,
scheduler_enabled: false

# Configure your database
#
# The MIX_TEST_PARTITION environment variable can be used
Expand Down
4 changes: 2 additions & 2 deletions lib/ppr_api/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ defmodule PprApi.Application do
]

children =
if Mix.env() != :test do
children ++ [PprApi.Scheduler]
if Application.get_env(:ppr_api, :scheduler_enabled) do
Enum.concat(children, [PprApi.Scheduler])
else
children
end
Expand Down
Binary file not shown.
6 changes: 6 additions & 0 deletions priv/static/images/logo-06a11be1f2cdde2c851763d00bdd2e80.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added priv/static/images/logo.svg.gz
Binary file not shown.
5 changes: 5 additions & 0 deletions priv/static/robots-9e2c81b0855bbff2baa8371bc4a78186.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
#
# To ban all spiders from the entire site uncomment the next two lines:
# User-agent: *
# Disallow: /
Binary file not shown.
Binary file added priv/static/robots.txt.gz
Binary file not shown.
5 changes: 5 additions & 0 deletions rel/overlays/bin/migrate
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
set -eu

cd -P -- "$(dirname -- "$0")"
exec ./ppr_api eval PprApi.Release.migrate
1 change: 1 addition & 0 deletions rel/overlays/bin/migrate.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
call "%~dp0\ppr_api" eval PprApi.Release.migrate
5 changes: 5 additions & 0 deletions rel/overlays/bin/server
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
set -eu

cd -P -- "$(dirname -- "$0")"
PHX_SERVER=true exec ./ppr_api start
2 changes: 2 additions & 0 deletions rel/overlays/bin/server.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
set PHX_SERVER=true
call "%~dp0\ppr_api" start

0 comments on commit 6f06ae2

Please sign in to comment.