Оптимизировано потребление памяти для выборки email_actions на зачистку

This commit is contained in:
ErickSkrauch 2017-04-04 14:19:24 +03:00
parent 9a38481f7d
commit d7b193f2e7

View File

@ -17,8 +17,8 @@ class CleanupController extends Controller {
];
}
/** @var EmailActivation[] $expiredEmails */
$expiredEmails = $query->andWhere($conditions)->all();
/** @var \yii\db\BatchQueryResult|EmailActivation[] $expiredEmails */
$expiredEmails = $query->andWhere($conditions)->each();
foreach ($expiredEmails as $email) {
$email->delete();
}