mirror of
https://github.com/sogou/workflow.git
synced 2026-02-08 01:33:17 +08:00
Set redis task error when NOAUTH.
This commit is contained in:
@@ -213,6 +213,13 @@ bool ComplexRedisTask::need_redirect()
|
||||
if (reply->str == NULL)
|
||||
return false;
|
||||
|
||||
if (strncasecmp(reply->str, "NOAUTH ", 7) == 0)
|
||||
{
|
||||
this->state = WFT_STATE_TASK_ERROR;
|
||||
this->error = WFT_ERR_REDIS_ACCESS_DENIED;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool asking = false;
|
||||
if (strncasecmp(reply->str, "ASK ", 4) == 0)
|
||||
asking = true;
|
||||
@@ -316,14 +323,6 @@ protected:
|
||||
return &wrapper_;
|
||||
}
|
||||
|
||||
virtual int keep_alive_timeout()
|
||||
{
|
||||
if (!is_user_request_)
|
||||
return this->ComplexRedisTask::keep_alive_timeout();
|
||||
|
||||
return this->keep_alive_timeo;
|
||||
}
|
||||
|
||||
virtual int first_timeout()
|
||||
{
|
||||
return watching_ ? this->watch_timeo : 0;
|
||||
@@ -385,6 +384,11 @@ ComplexRedisSubscribeTask::SubscribeWrapper::next_in(ProtocolMessage *message)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!task_->watching_)
|
||||
{
|
||||
task_->finished_ = true;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
task_->watching_ = true;
|
||||
task_->extract_(task_);
|
||||
|
||||
Reference in New Issue
Block a user