PHRAS-3742 Admin flush session (#4131)

PHRAS-3742 : 
- flush session
- command
- redis remove by pattern
- cmd
- add log
- clean table session
This commit is contained in:
Aina Sitraka
2022-10-05 17:56:13 +03:00
committed by GitHub
parent 2c5dd80e54
commit f9de6877d2
16 changed files with 690 additions and 353 deletions

View File

@@ -11,6 +11,7 @@
namespace Alchemy\Phrasea\Model\Repositories;
use Doctrine\Common\Collections\Criteria;
use Doctrine\ORM\EntityRepository;
/**
@@ -21,4 +22,16 @@ use Doctrine\ORM\EntityRepository;
*/
class SessionRepository extends EntityRepository
{
public function deleteAllExceptSessionId($sessionId)
{
$criteria = new Criteria();
$criteria->where($criteria->expr()->neq('id', $sessionId));
$sessions = $this->matching($criteria);
foreach ($sessions as $session) {
$this->_em->remove($session);
}
$this->_em->flush();
}
}