1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 01:08:50 +02:00

Allow PhabricatorGlobalLock to block

Summary: See D2924.

Test Plan: Ran locks with blocking timeouts.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D2925
This commit is contained in:
epriestley 2012-07-05 16:03:43 -07:00
parent 67691c196e
commit ce360926b7

View file

@ -63,7 +63,7 @@ final class PhabricatorGlobalLock extends PhutilLock {
/* -( Implementation )----------------------------------------------------- */
protected function doLock() {
protected function doLock($wait) {
$conn = $this->conn;
if (!$conn) {
// NOTE: Using the 'repository' database somewhat arbitrarily, mostly
@ -87,9 +87,9 @@ final class PhabricatorGlobalLock extends PhutilLock {
$result = queryfx_one(
$conn,
'SELECT GET_LOCK(%s, %d)',
'SELECT GET_LOCK(%s, %f)',
'phabricator:'.$this->lockname,
0);
$wait);
$ok = head($result);
if (!$ok) {