Make bot_state_channel send data on legacy, and new channel

pull/974/head
Connor Rigby 2019-05-28 13:09:38 -07:00
parent 32580bf2ef
commit 57f4927973
No known key found for this signature in database
GPG Key ID: 29A88B24B70456E0
1 changed files with 5 additions and 2 deletions

View File

@ -58,13 +58,16 @@ defmodule FarmbotExt.AMQP.BotStateNGChannel do
end
def handle_cast(:force, state) do
bot_state = BotState.fetch()
changes = ChangeGenerator.changes(bot_state)
json =
BotState.fetch()
bot_state
|> BotStateNG.view()
|> JSON.encode!()
Basic.publish(state.chan, @exchange, "bot.#{state.jwt.bot}.status", json)
{:noreply, state, 0}
{:noreply, %{state | changes: changes}, 0}
end
def handle_info(:timeout, %{conn: nil, chan: nil} = state) do