(qa/v10.0.0-rc4) Experiment: Remove `state.status` guard clause from `close_transport` call?

qa/firmware_experiments
Rick Carlino 2020-05-01 15:28:49 -05:00
parent 92dea8b0a1
commit eaafcb55c2
2 changed files with 7 additions and 6 deletions

View File

@ -1 +1 @@
10.0.0-rc3
10.0.0-rc4

View File

@ -375,8 +375,7 @@ defmodule FarmbotFirmware do
# Closing the transport will purge the buffer of queued commands in both
# the `configuration_queue` and in the `command_queue`.
def handle_call(:close_transport, _from, %{status: s} = state)
when s != :transport_boot do
def handle_call(:close_transport, _from, state) do
if is_reference(state.transport_ref) do
true = Process.demonitor(state.transport_ref)
end
@ -404,9 +403,11 @@ defmodule FarmbotFirmware do
{:reply, :ok, next_state}
end
def handle_call(:close_transport, _, %{status: s} = state) do
{:reply, {:error, s}, state}
end
# WE MAY WANT TO REVERT THIS AND ADD GUARD CLAUSE BACK TO
# `handle_call` ABOVE THIS. RC 1 MAY 2020
# 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)
when s == :transport_boot do