]> git.proxmox.com Git - pmg-api.git/commitdiff
move open_ruledb() out of the loop
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 29 Mar 2018 12:16:43 +0000 (14:16 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 29 Mar 2018 12:17:43 +0000 (14:17 +0200)
PMG/API2/Quarantine.pm

index f4bc32c1be5ed868bdcc832482aad68a7b948a55..2724457ea7f36aebec47929bddfb2100ba97d4f0 100644 (file)
@@ -914,14 +914,14 @@ __PACKAGE__->register_method ({
        my $action = $param->{action};
        my @idlist = split(';', $param->{id});
 
+       my $dbh = PMG::DBTools::open_ruledb();
+
        for my $id (@idlist) {
            my ($cid, $rid, $tid) = $id =~ m/^C(\d+)R(\d+)T(\d+)$/;
            $cid = int($cid);
            $rid = int($rid);
            $tid = int($tid);
 
-           my $dbh = PMG::DBTools::open_ruledb();
-
            my $ref = PMG::DBTools::load_mail_data($dbh, $cid, $rid, $tid);
 
            if ($role eq 'quser') {