]> git.proxmox.com Git - pmg-api.git/commitdiff
do not use 'last' inside do/while
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 3 Oct 2018 10:12:29 +0000 (12:12 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 3 Oct 2018 10:12:29 +0000 (12:12 +0200)
Because this raises an exception.

PMG/Cluster.pm

index 5eb41b5046ae001aa2177086680f4f857c8a58e7..9e456f16e4b9f3690b8681f424a7e0ec2de1bc9f 100644 (file)
@@ -589,9 +589,7 @@ sub sync_quarantine_db {
 
        $mscount += $count;
 
 
        $mscount += $count;
 
-       last if $mscount >= $maxmails;
-
-    } while ($count >= $maxcount);
+    } while (($count >= $maxcount) && ($mscount < $maxmails));
 
     PMG::DBTools::create_clusterinfo_default($ldb, $rcid, 'lastmt_CMSReceivers', 0, undef);
 
 
     PMG::DBTools::create_clusterinfo_default($ldb, $rcid, 'lastmt_CMSReceivers', 0, undef);
 
@@ -689,9 +687,7 @@ sub sync_statistic_db {
 
        $mscount += $count;
 
 
        $mscount += $count;
 
-       last if $mscount >= $maxmails;
-
-    } while ($count >= $maxcount);
+    } while (($count >= $maxcount) && ($mscount < $maxmails));
 
     return $mscount;
 }
 
     return $mscount;
 }