syncdomain: don't do dummy SQL UPDATE's
[racktables] / scripts / syncdomain.php
index c75ba2aaecdcc4bc727838ed701b2b525e7eb90b..621851b4c0fb2475a285ed0dcc2ab77a01e1dda9 100755 (executable)
@@ -107,11 +107,11 @@ foreach ($switch_list as $object_id)
                $cell = spotEntity ('object', $object_id);
                if (considerConfiguredConstraint ($cell, 'SYNC_802Q_LISTSRC'))
                        $switch_queue[] = $cell;
-               else
+               elseif ($vswitch['last_errno'] != E_8021Q_SYNC_DISABLED)
                        usePreparedExecuteBlade
                        (
                                'UPDATE VLANSwitch SET out_of_sync="yes", last_error_ts=NOW(), last_errno=? WHERE object_id=?',
-                               array (E_8021Q_SYNC_DISABLED, $cell['id'])
+                               array (E_8021Q_SYNC_DISABLED, $object_id)
                        );
        }
 }