dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Add $wgRateLimits types ip-all and subnet-all"
[lhc/web/wiklou.git]
/
includes
/
db
/
DatabasePostgres.php
diff --git
a/includes/db/DatabasePostgres.php
b/includes/db/DatabasePostgres.php
index
4d9891e
..
e84f264
100644
(file)
--- a/
includes/db/DatabasePostgres.php
+++ b/
includes/db/DatabasePostgres.php
@@
-1581,11
+1581,13
@@
SQL;
"SELECT pg_try_advisory_lock($key) AS lockstatus", $method );
$row = $this->fetchObject( $result );
if ( $row->lockstatus === 't' ) {
"SELECT pg_try_advisory_lock($key) AS lockstatus", $method );
$row = $this->fetchObject( $result );
if ( $row->lockstatus === 't' ) {
+ parent::lock( $lockName, $method, $timeout ); // record
return true;
} else {
sleep( 1 );
}
}
return true;
} else {
sleep( 1 );
}
}
+
wfDebug( __METHOD__ . " failed to acquire lock\n" );
return false;
wfDebug( __METHOD__ . " failed to acquire lock\n" );
return false;
@@
-1603,7
+1605,14
@@
SQL;
$result = $this->query( "SELECT pg_advisory_unlock($key) as lockstatus", $method );
$row = $this->fetchObject( $result );
$result = $this->query( "SELECT pg_advisory_unlock($key) as lockstatus", $method );
$row = $this->fetchObject( $result );
- return ( $row->lockstatus === 't' );
+ if ( $row->lockstatus === 't' ) {
+ parent::unlock( $lockName, $method ); // record
+ return true;
+ }
+
+ wfDebug( __METHOD__ . " failed to release lock\n" );
+
+ return false;
}
/**
}
/**