Skip to content

Reloading jobs on a running server

Dimitrios Zorbas edited this page Mar 24, 2018 · 2 revisions

You can reload the source for any job on a running Kitto server without restarting it.

Example

Having started you Kitto dashboard app with:

iex --sname kitto -S mix kitto.server

You can then start another IEx session on the same machine like:

iex --sname ops

Then inside the ops session you can run:

GenServer.cast {:runner, :kitto@hostname}, {:reload_job, "jobs/your_job_goes_here.exs"}

where you have to replace hostname with the actual hostname of the machine.

:rpc.call :"kitto@hostname", Kitto.Runner, :reload_job, [:runner, "jobs/your_job_goes_here.exs"]

Distributed code essentials: http://elixir-lang.org/getting-started/mix-otp/distributed-tasks-and-configuration.html