Optimize memory usage for batch processing of template images
NewsletterTemplateEntity carries base64 data of image. This commit changes how we load templates entities when we process thumbnail images so that there is only one template in memory. [MAILPOET-2686]
This commit is contained in:
committed by
Veljko V
parent
ab23b06ff8
commit
5134713c2d
@@ -98,4 +98,14 @@ class NewsletterTemplatesRepository extends Repository {
|
||||
->getQuery()
|
||||
->getSingleScalarResult();
|
||||
}
|
||||
|
||||
public function getIdsOfEditableTemplates(): array {
|
||||
$result = $this->doctrineRepository->createQueryBuilder('nt')
|
||||
->select('nt.id')
|
||||
->where('nt.readonly = :readonly')
|
||||
->setParameter('readonly', false)
|
||||
->getQuery()
|
||||
->getArrayResult();
|
||||
return array_column($result, 'id');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user