acl icon indicating copy to clipboard operation
acl copied to clipboard

Removing Users taking too long Cake Acl

Open sanjeevrouhan opened this issue 6 years ago • 1 comments

I am removing records from users table, and it is taking too long aprox 1 min to delete a record from users and other table of ACL. How to speed this process up because i have more than 1 lakh entries in table to remove I am Using this code to remove users

$users = $this->Users->find()->where(['group_id' => 3]);

foreach($users as $key => $value){
    $id = $value->id;
    if($id){
       $user = $this->Users->get($id);
        $this->Users->delete($user);
    }
}

sanjeevrouhan avatar Apr 15 '19 12:04 sanjeevrouhan

Sounds like you might have a big ACL tree that just takes a long time to re-order.

markstory avatar Apr 15 '19 13:04 markstory