mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 00:24:21 +02:00
Revert all PHP-Based MySQL Locks introduced in #1584
This commit is contained in:
@@ -59,36 +59,6 @@ function dbQuery($sql, $parameters=array()) {
|
||||
}//end dbQuery()
|
||||
|
||||
|
||||
/*
|
||||
* Aquire a lock on a string
|
||||
* */
|
||||
function dbGetLock($data, $timeout = 0) {
|
||||
$sql = 'SELECT GET_LOCK(\'' . $data . '\',' . $timeout . ')';
|
||||
$result = dbFetchCell($sql);
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Check a lock on a string
|
||||
* */
|
||||
function dbCheckLock($data) {
|
||||
$sql = 'SELECT IS_FREE_LOCK(\'' . $data . '\')';
|
||||
$result = dbFetchCell($sql);
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Release a lock on a string
|
||||
* */
|
||||
function dbReleaseLock($data) {
|
||||
$sql = 'SELECT RELEASE_LOCK(\'' . $data . '\')';
|
||||
$result = dbFetchCell($sql);
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Passed an array and a table name, it attempts to insert the data into the table.
|
||||
* Check for boolean false to determine whether insert failed
|
||||
|
||||
@@ -59,35 +59,6 @@ function dbQuery($sql, $parameters=array()) {
|
||||
}//end dbQuery()
|
||||
|
||||
|
||||
/*
|
||||
* Aquire a lock on a string
|
||||
* */
|
||||
function dbGetLock($data, $timeout = 0) {
|
||||
$sql = 'SELECT GET_LOCK(\'' . $data . '\',' . $timeout . ')';
|
||||
$result = dbFetchCell($sql);
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Check a lock on a string
|
||||
* */
|
||||
function dbCheckLock($data) {
|
||||
$sql = 'SELECT IS_FREE_LOCK(\'' . $data . '\')';
|
||||
$result = dbFetchCell($sql);
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Release a lock on a string
|
||||
* */
|
||||
function dbReleaseLock($data) {
|
||||
$sql = 'SELECT RELEASE_LOCK(\'' . $data . '\')';
|
||||
$result = dbFetchCell($sql);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Passed an array and a table name, it attempts to insert the data into the table.
|
||||
* Check for boolean false to determine whether insert failed
|
||||
|
||||
@@ -91,13 +91,6 @@ if ($tmp[0] <= $db_rev) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!dbGetLock('schema_update')) {
|
||||
echo "Schema update already in progress. Exiting\n";
|
||||
exit(1);
|
||||
} //end if
|
||||
|
||||
register_shutdown_function('dbReleaseLock','schema_update');
|
||||
|
||||
foreach ($filelist as $file) {
|
||||
list($filename,$extension) = explode('.', $file, 2);
|
||||
if ($filename > $db_rev) {
|
||||
@@ -168,4 +161,3 @@ if ($updating) {
|
||||
echo "-- Done\n";
|
||||
}
|
||||
|
||||
dbReleaseLock('schema_update');
|
||||
|
||||
Reference in New Issue
Block a user