mirror of
https://github.com/processone/ejabberd.git
synced 2024-06-02 21:17:12 +02:00
Speedup startup with many pubsub nodes (EJAB-669)
SVN Revision: 1490
This commit is contained in:
parent
d9f3c87899
commit
782ee63266
|
@ -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
|
||||||
|
|
|
@ -286,8 +286,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
|
||||||
|
@ -114,7 +113,7 @@ get_nodes(Key) ->
|
||||||
%% Host = mod_pubsub:host()
|
%% Host = mod_pubsub:host()
|
||||||
%% Node = mod_pubsub:pubsubNode()
|
%% Node = mod_pubsub:pubsubNode()
|
||||||
get_subnodes(Host, Node) ->
|
get_subnodes(Host, Node) ->
|
||||||
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