fix celeryscript ast encodeing.
This commit is contained in:
parent
b782fb5f7e
commit
a67508eac5
|
@ -193,8 +193,8 @@ defmodule Farmbot.BotState do
|
|||
|
||||
@doc "Emit an AST."
|
||||
def emit(%AST{} = ast) do
|
||||
kind = Module.split(ast.kind) |> List.last |> Macro.underscore()
|
||||
GenStage.call(__MODULE__, {:emit, %{ast | kind: kind}})
|
||||
# kind = Module.split(ast.kind) |> List.last |> Macro.underscore()
|
||||
GenStage.call(__MODULE__, {:emit, ast})
|
||||
end
|
||||
|
||||
@doc "Get user env."
|
||||
|
|
|
@ -148,8 +148,11 @@ defmodule Farmbot.BotState.Transport.AMQP do
|
|||
end
|
||||
|
||||
defp emit_cs(chan, bot, cs) do
|
||||
json = Poison.encode!(cs)
|
||||
:ok = AMQP.Basic.publish chan, @exchange, "bot.#{bot}.from_device", json
|
||||
with {:ok, map} <- Farmbot.CeleryScript.AST.encode(cs),
|
||||
{:ok, json} <- Poison.encode(map)
|
||||
do
|
||||
:ok = AMQP.Basic.publish chan, @exchange, "bot.#{bot}.from_device", json
|
||||
end
|
||||
end
|
||||
|
||||
defp push_bot_state(chan, bot, state) do
|
||||
|
|
Loading…
Reference in a new issue