]> git.proxmox.com Git - pmg-api.git/blobdiff - PMG/Cluster.pm
do not use 'last' inside do/while
[pmg-api.git] / PMG / Cluster.pm
index 5eb41b5046ae001aa2177086680f4f857c8a58e7..9e456f16e4b9f3690b8681f424a7e0ec2de1bc9f 100644 (file)
@@ -589,9 +589,7 @@ sub sync_quarantine_db {
 
        $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);
 
@@ -689,9 +687,7 @@ sub sync_statistic_db {
 
        $mscount += $count;
 
-       last if $mscount >= $maxmails;
-
-    } while ($count >= $maxcount);
+    } while (($count >= $maxcount) && ($mscount < $maxmails));
 
     return $mscount;
 }