Skip to content

Commit

Permalink
Adding cronjob to fetch wikis
Browse files Browse the repository at this point in the history
  • Loading branch information
houshuang committed Jul 20, 2015
1 parent fdd1e8b commit 8ccdf2c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
13 changes: 10 additions & 3 deletions config/prod.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use Mix.Config

require Logger
# For production, we configure the host to read the PORT
# from the system environment. Therefore, you will need
# to set PORT=80 before running your server.
Expand Down Expand Up @@ -28,11 +28,11 @@ config :survey, Survey.Endpoint,
#
# Where those two env variables point to a file on
# disk for the key and cert.
config :logger,
config :logger,
backends: [:console, Logger.Backends.ErrorMail]

# Do not print debug messages in production
config :logger, :console,
config :logger, :console,
level: :info,
format: "$date $time $metadata[$level] $message\n",
metadata: [:id]
Expand All @@ -46,6 +46,13 @@ config :logger, :error_mail,
config :week,
current: 1

config :quantum, cron: [
"@hourly": fn ->
Logger.info("Updating all wiki cache")
Survey.Encore.update_all_wiki_cache
end
]

# ## Using releases
#
# If you are doing OTP releases, you need to instruct Phoenix
Expand Down
6 changes: 4 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ defmodule Survey.Mixfile do
def application do
[mod: {Survey, []},
applications: [:phoenix, :phoenix_html, :cowboy, :logger,
:phoenix_ecto, :postgrex, :dogstatsd, :httpoison, :plug_accesslog ]]
:phoenix_ecto, :postgrex, :dogstatsd, :httpoison, :plug_accesslog,
:quantum ]]
end

# Specifies which paths to compile per environment
Expand Down Expand Up @@ -51,7 +52,8 @@ defmodule Survey.Mixfile do
{:eiconv, github: "zotonic/eiconv"},
{:hashids, "~> 2.0"},
{:exactor, "~> 2.1.2"},
{:uuid, "~> 1.0"}
{:uuid, "~> 1.0"},
{:quantum, ">= 1.3.0"}
]
end
end
5 changes: 3 additions & 2 deletions mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@
"poolboy": {:hex, :poolboy, "1.5.1"},
"porcelain": {:hex, :porcelain, "2.0.0"},
"postgrex": {:hex, :postgrex, "0.8.4"},
"quantum": {:hex, :quantum, "1.3.0"},
"ranch": {:hex, :ranch, "1.0.0"},
"setup": {:git, "git://github.com/uwiger/setup.git", "51ee7c9f64d2bbe9dcbb58c278e8fbfd4d0ca5e2", [tag: "1.4"]},
"ssl_verify_hostname": {:hex, :ssl_verify_hostname, "1.0.5"},
"timex": {:hex, :timex, "0.15.0"},
"tzdata": {:hex, :tzdata, "0.1.6"},
"xmlrpc": {:hex, :xmlrpc, "0.6.0"},
"uuid": {:hex, :uuid, "1.0.1"}}
"uuid": {:hex, :uuid, "1.0.1"},
"xmlrpc": {:hex, :xmlrpc, "0.6.0"}}

0 comments on commit 8ccdf2c

Please sign in to comment.