(qa/v10.0.0-rc4) Experiment: Remove `state.status` guard clause from `close_transport` call?
parent
92dea8b0a1
commit
eaafcb55c2
|
@ -375,8 +375,7 @@ defmodule FarmbotFirmware do
|
||||||
|
|
||||||
# Closing the transport will purge the buffer of queued commands in both
|
# Closing the transport will purge the buffer of queued commands in both
|
||||||
# the `configuration_queue` and in the `command_queue`.
|
# the `configuration_queue` and in the `command_queue`.
|
||||||
def handle_call(:close_transport, _from, %{status: s} = state)
|
def handle_call(:close_transport, _from, state) do
|
||||||
when s != :transport_boot do
|
|
||||||
if is_reference(state.transport_ref) do
|
if is_reference(state.transport_ref) do
|
||||||
true = Process.demonitor(state.transport_ref)
|
true = Process.demonitor(state.transport_ref)
|
||||||
end
|
end
|
||||||
|
@ -404,9 +403,11 @@ defmodule FarmbotFirmware do
|
||||||
{:reply, :ok, next_state}
|
{:reply, :ok, next_state}
|
||||||
end
|
end
|
||||||
|
|
||||||
def handle_call(:close_transport, _, %{status: s} = state) do
|
# WE MAY WANT TO REVERT THIS AND ADD GUARD CLAUSE BACK TO
|
||||||
{:reply, {:error, s}, state}
|
# `handle_call` ABOVE THIS. RC 1 MAY 2020
|
||||||
end
|
# def handle_call(:close_transport, _, %{status: s} = state) do
|
||||||
|
# {:reply, {:error, s}, state}
|
||||||
|
# end
|
||||||
|
|
||||||
def handle_call({:open_transport, module, args}, _from, %{status: s} = state)
|
def handle_call({:open_transport, module, args}, _from, %{status: s} = state)
|
||||||
when s == :transport_boot do
|
when s == :transport_boot do
|
||||||
|
|
Loading…
Reference in New Issue