mirror of
https://github.com/processone/ejabberd.git
synced 2025-01-01 17:53:00 +01:00
Speedup startup with many pubsub nodes (EJAB-669)
SVN Revision: 1491
This commit is contained in:
parent
46e83cce55
commit
c68baa953e
@ -1,3 +1,9 @@
|
|||||||
|
2008-07-25 Christophe Romain <christophe.romain@process-one.net>
|
||||||
|
|
||||||
|
* src/mod_pubsub/mod_pubsub.erl: Speedup startup with many pubsub
|
||||||
|
nodes (EJAB-669)
|
||||||
|
* src/mod_pubsub/nodetree_default.erl: Likewise
|
||||||
|
|
||||||
2008-07-24 Badlop <badlop@process-one.net>
|
2008-07-24 Badlop <badlop@process-one.net>
|
||||||
|
|
||||||
* doc/guide.tex: Include example PAM configuration file
|
* doc/guide.tex: Include example PAM configuration file
|
||||||
|
@ -283,8 +283,7 @@ update_database(Host) ->
|
|||||||
mnesia:delete_table(pubsub_node),
|
mnesia:delete_table(pubsub_node),
|
||||||
mnesia:create_table(pubsub_node,
|
mnesia:create_table(pubsub_node,
|
||||||
[{disc_copies, [node()]},
|
[{disc_copies, [node()]},
|
||||||
{attributes, record_info(fields, pubsub_node)},
|
{attributes, record_info(fields, pubsub_node)}]),
|
||||||
{index, [type, parentid]}]),
|
|
||||||
lists:foreach(fun(Record) ->
|
lists:foreach(fun(Record) ->
|
||||||
mnesia:write(Record)
|
mnesia:write(Record)
|
||||||
end, NewRecords)
|
end, NewRecords)
|
||||||
|
@ -70,8 +70,7 @@
|
|||||||
init(_Host, _ServerHost, _Opts) ->
|
init(_Host, _ServerHost, _Opts) ->
|
||||||
mnesia:create_table(pubsub_node,
|
mnesia:create_table(pubsub_node,
|
||||||
[{disc_copies, [node()]},
|
[{disc_copies, [node()]},
|
||||||
{attributes, record_info(fields, pubsub_node)},
|
{attributes, record_info(fields, pubsub_node)}]),
|
||||||
{index, [type,parentid]}]),
|
|
||||||
NodesFields = record_info(fields, pubsub_node),
|
NodesFields = record_info(fields, pubsub_node),
|
||||||
case mnesia:table_info(pubsub_node, attributes) of
|
case mnesia:table_info(pubsub_node, attributes) of
|
||||||
[host_node, host_parent, info] -> ok; % old schema, updated later by pubsub
|
[host_node, host_parent, info] -> ok; % old schema, updated later by pubsub
|
||||||
@ -115,7 +114,7 @@ get_nodes(Key) ->
|
|||||||
%% Node = mod_pubsub:pubsubNode()
|
%% Node = mod_pubsub:pubsubNode()
|
||||||
%% From = mod_pubsub:jid()
|
%% From = mod_pubsub:jid()
|
||||||
get_subnodes(Host, Node, _From) ->
|
get_subnodes(Host, Node, _From) ->
|
||||||
mnesia:index_read(pubsub_node, {Host, Node}, #pubsub_node.parentid).
|
mnesia:match_object(#pubsub_node{parentid = {Host, Node}, _ = '_'}).
|
||||||
|
|
||||||
%% @spec (Host, Index) -> [pubsubNode()] | {error, Reason}
|
%% @spec (Host, Index) -> [pubsubNode()] | {error, Reason}
|
||||||
%% Host = mod_pubsub:host()
|
%% Host = mod_pubsub:host()
|
||||||
|
Loading…
Reference in New Issue
Block a user