Skip to content

Commit

Permalink
add standup cron refs #1
Browse files Browse the repository at this point in the history
  • Loading branch information
techgaun committed Aug 17, 2016
1 parent 9ce8f9a commit d17622a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 2 additions & 0 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ config :ex_mustang, ExMustang.Robot,
{ExMustang.Responders.Quote, []}
]

config :quantum, timezone: :local


# This configuration is loaded before any dependency and is restricted
# to this project. If another project depends on this project, this
Expand Down
9 changes: 8 additions & 1 deletion lib/ex_mustang.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,17 @@ defmodule ExMustang do
# worker(ExMustang.Worker, [arg1, arg2, arg3]),
worker(ExMustang.Robot, [])
]

add_jobs()
# See http://elixir-lang.org/docs/stable/elixir/Supervisor.html
# for other strategies and supported options
opts = [strategy: :one_for_one, name: ExMustang.Supervisor]
Supervisor.start_link(children, opts)
end

def add_jobs do
Quantum.add_job(:standup, %Quantum.Job{
schedule: Application.get_env(:ex_mustang, ExMustang.Responders.Standup)[:time_of_day],
task: fn -> ExMustang.Responders.Standup.run end
})
end
end
2 changes: 1 addition & 1 deletion lib/ex_mustang/responders/quote.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defmodule ExMustang.Responders.Quote do
@moduledoc """
Random Quote, FTW!
Sends random message each day or when someone says `quote`
Sends random message when someone says `quote`
"""
use Hedwig.Responder

Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ defmodule ExMustang.Mixfile do
#
# Type "mix help compile.app" for more information
def application do
[applications: [:logger, :hedwig_slack],
[applications: [:logger, :hedwig_slack, :quantum, :tentacat],
mod: {ExMustang, []}]
end

Expand Down

0 comments on commit d17622a

Please # to comment.