parent
3225edde24
commit
09fa4a0ca7
|
@ -144,11 +144,15 @@ create_node(Key, Node, Type, Owner, Options) ->
|
||||||
{[], true};
|
{[], true};
|
||||||
_ ->
|
_ ->
|
||||||
Parent = lists:sublist(Node, length(Node) - 1),
|
Parent = lists:sublist(Node, length(Node) - 1),
|
||||||
(Parent == []) orelse
|
case Parent of
|
||||||
|
[] ->
|
||||||
|
{[], true};
|
||||||
|
_ ->
|
||||||
case mnesia:read({pubsub_node, {Key, Parent}}) of
|
case mnesia:read({pubsub_node, {Key, Parent}}) of
|
||||||
[] -> {Parent, false};
|
[] -> {Parent, false};
|
||||||
_ -> {Parent, true}
|
_ -> {Parent, true}
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
case ParentExists of
|
case ParentExists of
|
||||||
true ->
|
true ->
|
||||||
|
|
Loading…
Reference in New Issue