This commit is contained in:
Feng 2015-12-16 11:04:20 +08:00
parent d3ee464789
commit 7cd5367f3b
1 changed files with 1 additions and 1 deletions

View File

@ -150,7 +150,7 @@ create(topic, Topic) when is_binary(Topic) ->
{aborted, Error} -> {error, Error} {aborted, Error} -> {error, Error}
end; end;
create(subscription, {SubId, Topic, Qos}) -> create(subscription, {SubId, Topic, Qos}) when is_binary(SubId) andalso is_binary(Topic) ->
case mnesia:transaction(fun add_subscription/2, [SubId, {Topic, Qos}]) of case mnesia:transaction(fun add_subscription/2, [SubId, {Topic, Qos}]) of
{atomic, ok} -> ok; {atomic, ok} -> ok;
{aborted, Error} -> {error, Error} {aborted, Error} -> {error, Error}