From c669820481b8c431f4238d6b2d958e9dbfec411a Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 15 Jan 2011 16:11:31 -0500 Subject: Added an amsg kicker --- modules/extra/db_mysql_live.cpp | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) (limited to 'modules/extra') diff --git a/modules/extra/db_mysql_live.cpp b/modules/extra/db_mysql_live.cpp index f110b631d..bf5a1e6f7 100644 --- a/modules/extra/db_mysql_live.cpp +++ b/modules/extra/db_mysql_live.cpp @@ -85,30 +85,33 @@ class MySQLLiveModule : public Module, public Pipe EventReturn OnPreCommand(CommandSource &source, Command *command, const std::vector ¶ms) { - CommandMutex *cm = new CommandMutex(); - try + if (this->SQL) { - cm->mutex.Lock(); - cm->command = command; - cm->source = source; - cm->params = params; + CommandMutex *cm = new CommandMutex(); + try + { + cm->mutex.Lock(); + cm->command = command; + cm->source = source; + cm->params = params; - commands.push_back(cm); + commands.push_back(cm); - // Give processing to the command thread - Log(LOG_DEBUG_2) << "db_mysql_live: Waiting for command thread " << cm->command->name << " from " << source.u->nick; - threadEngine.Start(cm); - main_mutex.Lock(); - } - catch (const CoreException &ex) - { - delete cm; - Log() << "db_mysql_live: Unable to thread for command: " << ex.GetReason(); + // Give processing to the command thread + Log(LOG_DEBUG_2) << "db_mysql_live: Waiting for command thread " << cm->command->name << " from " << source.u->nick; + threadEngine.Start(cm); + main_mutex.Lock(); - return EVENT_CONTINUE; + return EVENT_STOP; + } + catch (const CoreException &ex) + { + delete cm; + Log() << "db_mysql_live: Unable to thread for command: " << ex.GetReason(); + } } - return EVENT_STOP; + return EVENT_CONTINUE; } void OnNotify() -- cgit