From 4182b46e67185e1f024a24e7cba0d82e24f29baa Mon Sep 17 00:00:00 2001 From: nsensfel Date: Thu, 11 Oct 2018 17:02:20 +0200 Subject: Woops, that isn't how gen_server:call works. --- src/db/struct/db_item_ids_manager.erl | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/db/struct/db_item_ids_manager.erl') diff --git a/src/db/struct/db_item_ids_manager.erl b/src/db/struct/db_item_ids_manager.erl index 999a047..e2af8a6 100644 --- a/src/db/struct/db_item_ids_manager.erl +++ b/src/db/struct/db_item_ids_manager.erl @@ -187,13 +187,12 @@ handle_info(_, State) -> %%%% Interface Functions -spec allocate (atom()) -> binary(). allocate (DB) -> - gen_server:call({global, db_item_ids_manager}, {allocate, DB}), + {allocated_id, Result} = + gen_server:call({global, db_item_ids_manager}, {allocate, DB}), - receive - {allocated_id, Result} -> - io:format("~n[DB: ~p] Item ID ~p allocated.~n", [DB, Result]), - Result - end. + io:format("~n[DB: ~p] Item ID ~p allocated.~n", [DB, Result]), + + Result. -spec free (binary(), atom()) -> 'ok'. free (ID, DB) -> -- cgit v1.2.3-70-g09d2