Skip to content

Commit

Permalink
make reporting frequency configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Newell committed May 10, 2016
1 parent 9e6e0d5 commit b87cb64
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/ambrosia_monitor/reporter.ex
Expand Up @@ -2,12 +2,12 @@ defmodule AmbrosiaMonitor.Reporter do
use GenServer
require Logger

def start_link(database, url, _frequency) do
GenServer.start_link(__MODULE__, {database, url}, name: __MODULE__)
def start_link(database, url, frequency) do
GenServer.start_link(__MODULE__, {database, url, frequency}, name: __MODULE__)
end

def init(database, url) do
:timer.send_interval(5_000, :report_measurements)
def init(database, url, frequency) do
:timer.send_interval(frequency, :report_measurements)
{:ok, %{database: database, url: url}}
end

Expand Down

0 comments on commit b87cb64

Please sign in to comment.