diff --git a/VERSION b/VERSION index dc1c1cff..f71ccdb3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.0.0-rc36 +10.0.0-rc37 diff --git a/farmbot_core/lib/farmbot_core/asset/private.ex b/farmbot_core/lib/farmbot_core/asset/private.ex index 5ae41ad1..b66a30aa 100644 --- a/farmbot_core/lib/farmbot_core/asset/private.ex +++ b/farmbot_core/lib/farmbot_core/asset/private.ex @@ -5,6 +5,7 @@ defmodule FarmbotCore.Asset.Private do _are_ stored in Farmbot's database. """ require Logger + require FarmbotCore.Logger alias FarmbotCore.{Asset.Repo, Asset.Private.LocalMeta, @@ -15,14 +16,28 @@ defmodule FarmbotCore.Asset.Private do @doc "Lists `module` objects that still need to be POSTed to the API." def list_local(module) do - Repo.all(from(data in module, where: is_nil(data.id))) + list = Repo.all(from(data in module, where: is_nil(data.id))) + Enum.map(list, fn item -> + if module == FarmbotCore.Asset.Point do + msg = "list_local: Point#{item.id}.y = #{item.y || "nil"}" + FarmbotCore.Logger.info(3, msg) + end + item + end) end @doc "Lists `module` objects that have a `local_meta` object" def list_dirty(module) do table = table(module) q = from(lm in LocalMeta, where: lm.table == ^table, select: lm.asset_local_id) - Repo.all(from(data in module, join: lm in subquery(q))) + list = Repo.all(from(data in module, join: lm in subquery(q))) + Enum.map(list, fn item -> + if module == FarmbotCore.Asset.Point do + msg = "list_local: Point#{item.id}.y = #{item.y || "nil"}" + FarmbotCore.Logger.info(3, msg) + end + item + end) end def maybe_get_local_meta(asset, table) do diff --git a/farmbot_ext/lib/farmbot_ext/api/dirty_worker.ex b/farmbot_ext/lib/farmbot_ext/api/dirty_worker.ex index ae4548c8..a8d9bb1c 100644 --- a/farmbot_ext/lib/farmbot_ext/api/dirty_worker.ex +++ b/farmbot_ext/lib/farmbot_ext/api/dirty_worker.ex @@ -51,10 +51,6 @@ defmodule FarmbotExt.API.DirtyWorker do end def work(dirty, module) do - if module == FarmbotCore.Asset.Point do - FarmbotCore.Logger.info(3, "#{__MODULE__} Point#{dirty.id}.y = #{dirty.y}") - end - case http_request(dirty, module) do # Valid data {:ok, %{status: s, body: body}} when s > 199 and s < 300 -> diff --git a/farmbot_os/lib/farmbot_os/sys_calls/resource_update.ex b/farmbot_os/lib/farmbot_os/sys_calls/resource_update.ex index c0ffa9f9..3f8ab5ec 100644 --- a/farmbot_os/lib/farmbot_os/sys_calls/resource_update.ex +++ b/farmbot_os/lib/farmbot_os/sys_calls/resource_update.ex @@ -32,11 +32,11 @@ defmodule FarmbotOS.SysCalls.ResourceUpdate do "Weed" => "weed" } - def notify_user_of_updates(kind, params) do + def notify_user_of_updates(kind, params, id \\ nil) do Enum.map(params, fn {k, v} -> name = @friendly_names[kind] || kind property = @friendly_names["#{k}"] || k - msg = "Setting #{name} #{property} to #{inspect(v)}" + msg = "Setting #{name} #{id} #{property} to #{inspect(v)}" FarmbotCore.Logger.info(3, msg) end) end @@ -53,7 +53,7 @@ defmodule FarmbotOS.SysCalls.ResourceUpdate do end def update_resource(kind, id, params) when kind in @point_kinds do - notify_user_of_updates(kind, params) + notify_user_of_updates(kind, params, id) params = do_handlebars(params) point_update_resource(kind, id, params) end