wait for all locks to be free when updating schema

This commit is contained in:
Clint Armstrong 2015-07-22 08:09:19 -04:00
parent 777d5d6c6f
commit 1379a13c76

View File

@ -34,7 +34,11 @@ if (!isset($debug)) {
if (!dbGetLock('schema_update')) {
echo "Schema update already in progress. Exiting";
exit(1);
}
} //end if
do {
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);
$insert = 0;