mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-07 05:39:39 +00:00
sounds_index: Avoid repeatedly reindexing.
The sounds index is rebuilt each time a format is registered or unregistered. This causes the index to be repeatedly rebuilt during startup and shutdown. This patch significantly reduces the work done by delaying sound index initialization until after modules are loaded. This way a reindex only occurs if a format module is loaded after startup. We also skip reindexing when format modules are unloaded during shutdown. Change-Id: I585fd6ee04200612ab1490dc804f76805f89cf0a
This commit is contained in:
@@ -4701,9 +4701,14 @@ static void asterisk_daemon(int isroot, const char *runuser, const char *rungrou
|
||||
check_init(init_manager(), "Asterisk Manager Interface");
|
||||
check_init(ast_enum_init(), "ENUM Support");
|
||||
check_init(ast_cc_init(), "Call Completion Supplementary Services");
|
||||
check_init(ast_sounds_index_init(), "Sounds Indexer");
|
||||
check_init(load_modules(0), "Module");
|
||||
|
||||
/*
|
||||
* This is initialized after the dynamic modules load to avoid repeatedly
|
||||
* reindexing sounds for every format module load.
|
||||
*/
|
||||
check_init(ast_sounds_index_init(), "Sounds Indexer");
|
||||
|
||||
/* loads the cli_permissoins.conf file needed to implement cli restrictions. */
|
||||
ast_cli_perms_init(0);
|
||||
|
||||
|
Reference in New Issue
Block a user