allow to specify how many times we can try to connect to the database at startup
add config options: db_startup_connection_max_attempts - default 0 (infinite) db_startup_connection_attempt_delay - delay in seconds between attempts (default 5) BREAKING CHANGE: WINIX_PLUGIN_INIT plugin message requires to set result status, you have to set the result status to true (env.res) if your plugin was initialized correctly, otherwise winix will not start
This commit is contained in:
@@ -85,14 +85,16 @@ void Notify::SetThreadManager(ThreadManager * pmanager)
|
||||
|
||||
|
||||
|
||||
void Notify::Init()
|
||||
bool Notify::Init()
|
||||
{
|
||||
//notify_thread.SetConfig(config);
|
||||
notify_thread.SetUsers(users);
|
||||
notify_thread.SetNotifyPool(¬ify_pool);
|
||||
notify_thread.SetPatterns(&patterns);
|
||||
//notify_thread.SetFileLog(file_log);
|
||||
thread_manager->Add(¬ify_thread, L"notifications");
|
||||
|
||||
if( !thread_manager->Add(¬ify_thread, L"notifications") )
|
||||
return false;
|
||||
|
||||
patterns.SetDirectories(config->txt_templates_dir, config->txt_templates_dir_default);
|
||||
patterns.SetLocale(&TemplatesFunctions::locale);
|
||||
@@ -103,6 +105,8 @@ void Notify::Init()
|
||||
notify_template_reset_password = AddTemplate(L"notify_reset_password.txt");
|
||||
|
||||
plugin->Call((Session*)0, WINIX_NOTIFY_ADD_TEMPLATE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -70,7 +70,7 @@ public:
|
||||
void SetThreadManager(ThreadManager * pmanager);
|
||||
//void SetFileLog(FileLog * file_log);
|
||||
|
||||
void Init();
|
||||
bool Init();
|
||||
|
||||
size_t AddTemplate(const std::wstring & file_name);
|
||||
void ReadTemplates();
|
||||
|
Reference in New Issue
Block a user