mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-18 17:28:56 +00:00
Merge remote-tracking branch 'dhruvgoel92/ticket/11032' into develop
* dhruvgoel92/ticket/11032: [ticket/11032] sphinx retries before triggering error
This commit is contained in:
commit
7efca53b47
1 changed files with 9 additions and 9 deletions
|
@ -492,6 +492,15 @@ class phpbb_search_fulltext_sphinx
|
||||||
$this->sphinx->SetLimits($start, (int) $per_page, SPHINX_MAX_MATCHES);
|
$this->sphinx->SetLimits($start, (int) $per_page, SPHINX_MAX_MATCHES);
|
||||||
$result = $this->sphinx->Query($search_query_prefix . str_replace('"', '"', $this->search_query), $this->indexes);
|
$result = $this->sphinx->Query($search_query_prefix . str_replace('"', '"', $this->search_query), $this->indexes);
|
||||||
|
|
||||||
|
// Could be connection to localhost:9312 failed (errno=111,
|
||||||
|
// msg=Connection refused) during rotate, retry if so
|
||||||
|
$retries = SPHINX_CONNECT_RETRIES;
|
||||||
|
while (!$result && (strpos($this->sphinx->GetLastError(), "errno=111,") !== false) && $retries--)
|
||||||
|
{
|
||||||
|
usleep(SPHINX_CONNECT_WAIT_TIME);
|
||||||
|
$result = $this->sphinx->Query($search_query_prefix . str_replace('"', '"', $this->search_query), $this->indexes);
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->sphinx->GetLastError())
|
if ($this->sphinx->GetLastError())
|
||||||
{
|
{
|
||||||
add_log('critical', 'LOG_SPHINX_ERROR', $this->sphinx->GetLastError());
|
add_log('critical', 'LOG_SPHINX_ERROR', $this->sphinx->GetLastError());
|
||||||
|
@ -505,15 +514,6 @@ class phpbb_search_fulltext_sphinx
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Could be connection to localhost:9312 failed (errno=111,
|
|
||||||
// msg=Connection refused) during rotate, retry if so
|
|
||||||
$retries = SPHINX_CONNECT_RETRIES;
|
|
||||||
while (!$result && (strpos($this->sphinx->GetLastError(), "errno=111,") !== false) && $retries--)
|
|
||||||
{
|
|
||||||
usleep(SPHINX_CONNECT_WAIT_TIME);
|
|
||||||
$result = $this->sphinx->Query($search_query_prefix . str_replace('"', '"', $this->search_query), $this->indexes);
|
|
||||||
}
|
|
||||||
|
|
||||||
$id_ary = array();
|
$id_ary = array();
|
||||||
if (isset($result['matches']))
|
if (isset($result['matches']))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue