mirror of
https://github.com/sogou/workflow.git
synced 2026-02-08 01:33:17 +08:00
Fix MySQL connection bug. Cannot use get_target() if not connected.
This commit is contained in:
@@ -243,7 +243,7 @@ CommMessageOut *ComplexMySQLTask::message_out()
|
||||
case ST_FIRST_USER_REQUEST:
|
||||
if (this->is_fixed_addr())
|
||||
{
|
||||
auto *target = (RouteManager::RouteTarget *)this->get_target();
|
||||
auto *target = (RouteManager::RouteTarget *)this->target;
|
||||
|
||||
/* If it's a transaction task, generate a ECONNRESET error when
|
||||
* the target was reconnected. */
|
||||
@@ -744,9 +744,8 @@ bool ComplexMySQLTask::finish_once()
|
||||
{
|
||||
if (this->state != WFT_STATE_SUCCESS || this->keep_alive_timeo == 0)
|
||||
{
|
||||
CommTarget *target = this->get_target();
|
||||
if (target)
|
||||
((RouteManager::RouteTarget *)target)->state = 0;
|
||||
if (this->target)
|
||||
((RouteManager::RouteTarget *)this->target)->state = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user