syncdomain: don't do dummy SQL UPDATE's
authorAlexey Andriyanov <alan@al-an.info>
Tue, 10 Dec 2013 17:29:59 +0000 (21:29 +0400)
committerAlexey Andriyanov <alan@al-an.info>
Tue, 10 Dec 2013 17:31:54 +0000 (21:31 +0400)
don't update out-of-sync switch status each time when switch is disabled

scripts/syncdomain.php

index c75ba2a..621851b 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)
                        );
        }
 }