mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Added lock release for schema updates even if it gets aborted or received sigterm
This commit is contained in:
@@ -96,6 +96,8 @@ if (!dbGetLock('schema_update')) {
|
|||||||
exit(1);
|
exit(1);
|
||||||
} //end if
|
} //end if
|
||||||
|
|
||||||
|
register_shutdown_function('dbReleaseLock','schema_update');
|
||||||
|
|
||||||
do {
|
do {
|
||||||
sleep(1);
|
sleep(1);
|
||||||
} while (@dbFetchCell('SELECT COUNT(*) FROM `devices` WHERE NOT IS_FREE_LOCK(CONCAT("polling.", device_id)) OR NOT IS_FREE_LOCK(CONCAT("queued.", device_id)) OR NOT IS_FREE_LOCK(CONCAT("discovering.", device_id))') > 0);
|
} while (@dbFetchCell('SELECT COUNT(*) FROM `devices` WHERE NOT IS_FREE_LOCK(CONCAT("polling.", device_id)) OR NOT IS_FREE_LOCK(CONCAT("queued.", device_id)) OR NOT IS_FREE_LOCK(CONCAT("discovering.", device_id))') > 0);
|
||||||
@@ -169,5 +171,3 @@ if ($updating) {
|
|||||||
|
|
||||||
echo "-- Done\n";
|
echo "-- Done\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
dbReleaseLock('schema_update');
|
|
||||||
|
|||||||
Reference in New Issue
Block a user