summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2018-10-11 17:02:20 +0200
committernsensfel <SpamShield0@noot-noot.org>2018-10-11 17:02:20 +0200
commit4182b46e67185e1f024a24e7cba0d82e24f29baa (patch)
treee00b468978f91e064b29a2bc35ded465db4d2666 /src
parentbd1f3d6aaaaf14d6bb0ef6d18cbfb1a149d727dc (diff)
Woops, that isn't how gen_server:call works.
Diffstat (limited to 'src')
-rw-r--r--src/db/struct/db_item_ids_manager.erl11
-rw-r--r--src/shared/struct/shr_db_user.erl1
2 files changed, 5 insertions, 7 deletions
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) ->
diff --git a/src/shared/struct/shr_db_user.erl b/src/shared/struct/shr_db_user.erl
index 991fb64..6087833 100644
--- a/src/shared/struct/shr_db_user.erl
+++ b/src/shared/struct/shr_db_user.erl
@@ -30,6 +30,5 @@ can_access (any, _) -> true;
can_access (janitor, janitor) -> true;
can_access (List, {user, User}) ->
lists:member({user, User}, List);
-can_access (janitor, janitor) -> true;
can_access (List, janitor) ->
lists:member(janitor, List).