diff options
| author | Adam <Adam@anope.org> | 2011-01-15 16:11:31 -0500 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2011-01-15 16:11:31 -0500 |
| commit | c669820481b8c431f4238d6b2d958e9dbfec411a (patch) | |
| tree | eaa7e25756bed697553db9529cb490dc954a73a3 /modules/extra | |
| parent | ecc2fc6029567d1d2f4d02d36bf64216ae9a03ee (diff) | |
Added an amsg kicker
Diffstat (limited to 'modules/extra')
| -rw-r--r-- | modules/extra/db_mysql_live.cpp | 39 |
1 files changed, 21 insertions, 18 deletions
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<Anope::string> ¶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() |
