From: Dietmar Maurer Date: Wed, 3 Oct 2018 10:12:29 +0000 (+0200) Subject: do not use 'last' inside do/while X-Git-Url: https://git.proxmox.com/?p=pmg-api.git;a=commitdiff_plain;h=d4c2f64630603ed06ecc9f2c639e1f916ce62a66 do not use 'last' inside do/while Because this raises an exception. --- diff --git a/PMG/Cluster.pm b/PMG/Cluster.pm index 5eb41b5..9e456f1 100644 --- a/PMG/Cluster.pm +++ b/PMG/Cluster.pm @@ -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; }