fix buffer
This commit is contained in:
parent
2ca06f97fe
commit
7f0b5e546c
@ -66,7 +66,12 @@ init([]) ->
|
|||||||
{stop, Reason :: term(), Reply :: term(), NewState :: #state{}} |
|
{stop, Reason :: term(), Reply :: term(), NewState :: #state{}} |
|
||||||
{stop, Reason :: term(), NewState :: #state{}}).
|
{stop, Reason :: term(), NewState :: #state{}}).
|
||||||
handle_call({find_device, DeviceUUID}, _From, State = #state{devices_map = DevicesMap}) ->
|
handle_call({find_device, DeviceUUID}, _From, State = #state{devices_map = DevicesMap}) ->
|
||||||
{reply, maps:find(DeviceUUID, DevicesMap), State}.
|
case maps:take(DeviceUUID, DevicesMap) of
|
||||||
|
error ->
|
||||||
|
{reply, error, State};
|
||||||
|
{DeviceInfo, NDevicesMap} ->
|
||||||
|
{reply, {ok, DeviceInfo}, State#state{devices_map = NDevicesMap}}
|
||||||
|
end.
|
||||||
|
|
||||||
%% @private
|
%% @private
|
||||||
%% @doc Handling cast messages
|
%% @doc Handling cast messages
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user