Differential D19807 Diff 47327 src/infrastructure/daemon/workers/query/PhabricatorWorkerTaskQuery.php
Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/daemon/workers/query/PhabricatorWorkerTaskQuery.php
Show First 20 Lines • Show All 97 Lines • ▼ Show 20 Lines | if ($this->maxFailureCount !== null) { | ||||
$conn, | $conn, | ||||
'failureCount <= %d', | 'failureCount <= %d', | ||||
$this->maxFailureCount); | $this->maxFailureCount); | ||||
} | } | ||||
return $this->formatWhereClause($conn, $where); | return $this->formatWhereClause($conn, $where); | ||||
} | } | ||||
protected function buildOrderClause(AphrontDatabaseConnection $conn_r) { | protected function buildOrderClause(AphrontDatabaseConnection $conn) { | ||||
// NOTE: The garbage collector executes this query with a date constraint, | // NOTE: The garbage collector executes this query with a date constraint, | ||||
// and the query is inefficient if we don't use the same key for ordering. | // and the query is inefficient if we don't use the same key for ordering. | ||||
// See T9808 for discussion. | // See T9808 for discussion. | ||||
if ($this->dateCreatedBefore) { | if ($this->dateCreatedBefore) { | ||||
return qsprintf($conn_r, 'ORDER BY dateCreated DESC, id DESC'); | return qsprintf($conn, 'ORDER BY dateCreated DESC, id DESC'); | ||||
} else if ($this->dateModifiedSince) { | } else if ($this->dateModifiedSince) { | ||||
return qsprintf($conn_r, 'ORDER BY dateModified DESC, id DESC'); | return qsprintf($conn, 'ORDER BY dateModified DESC, id DESC'); | ||||
} else { | } else { | ||||
return qsprintf($conn_r, 'ORDER BY id DESC'); | return qsprintf($conn, 'ORDER BY id DESC'); | ||||
} | } | ||||
} | } | ||||
protected function buildLimitClause(AphrontDatabaseConnection $conn_r) { | protected function buildLimitClause(AphrontDatabaseConnection $conn) { | ||||
$clause = ''; | |||||
if ($this->limit) { | if ($this->limit) { | ||||
$clause = qsprintf($conn_r, 'LIMIT %d', $this->limit); | return qsprintf($conn, 'LIMIT %d', $this->limit); | ||||
} else { | |||||
return qsprintf($conn, ''); | |||||
} | } | ||||
return $clause; | |||||
} | } | ||||
} | } |