This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule MyApp.Periodically do | |
use GenServer | |
def start_link do | |
GenServer.start_link(__MODULE__, %{}) | |
end | |
def init(state) do | |
Process.send_after(self(), :work, 2 * 60 * 60 * 1000) # In 2 hours | |
{:ok, state} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
# Feel free to change any of the following variables for your app: | |
TIMEOUT=${TIMEOUT-60} | |
APP_ROOT=/home/deploy/taxscribe/current | |
PID=$APP_ROOT/tmp/pids/unicorn.pid | |
CMD="/usr/local/bin/unicorn --config-file $APP_ROOT/config/unicorn.server.rb --env production --daemonize $APP_ROOT/config.ru" | |
action="$1" |