add mysql lock for polling

This commit is contained in:
Clint Armstrong
2015-07-06 09:25:23 -04:00
parent 43d13c66e9
commit e7c51f2a80
3 changed files with 60 additions and 3 deletions
+5 -3
View File
@@ -110,9 +110,11 @@ if (!isset($query)) {
foreach (dbFetch($query) as $device) {
$device = dbFetchRow("SELECT * FROM `devices` WHERE `device_id` = '".$device['device_id']."'");
poll_device($device, $options);
RunRules($device['device_id']);
echo "\r\n";
if (dbGetLock('polling.' . $device['device_id'])) {
poll_device($device, $options);
RunRules($device['device_id']);
echo "\r\n";
}
$polled_devices++;
}