Code Duplication    Length = 7-8 lines in 2 locations

includes/db/DatabasePostgres.php 1 location

@@ 1564-1571 (lines=8) @@
1561
	 * @return bool
1562
	 * @since 1.20
1563
	 */
1564
	public function lockIsFree( $lockName, $method ) {
1565
		$key = $this->addQuotes( $this->bigintFromLockName( $lockName ) );
1566
		$result = $this->query( "SELECT (CASE(pg_try_advisory_lock($key))
1567
			WHEN 'f' THEN 'f' ELSE pg_advisory_unlock($key) END) AS lockstatus", $method );
1568
		$row = $this->fetchObject( $result );
1569
1570
		return ( $row->lockstatus === 't' );
1571
	}
1572
1573
	/**
1574
	 * See http://www.postgresql.org/docs/8.2/static/functions-admin.html#FUNCTIONS-ADVISORY-LOCKS

includes/db/DatabaseMysqlBase.php 1 location

@@ 968-974 (lines=7) @@
965
	 * @return bool
966
	 * @since 1.20
967
	 */
968
	public function lockIsFree( $lockName, $method ) {
969
		$lockName = $this->addQuotes( $this->makeLockName( $lockName ) );
970
		$result = $this->query( "SELECT IS_FREE_LOCK($lockName) AS lockstatus", $method );
971
		$row = $this->fetchObject( $result );
972
973
		return ( $row->lockstatus == 1 );
974
	}
975
976
	/**
977
	 * @param string $lockName