Answer the question
In order to leave comments, you need to log in
Yii2 is mercilessly leaky. what to do?
there is such a simple thing
Console::startProgress($done, $total);
foreach ($udi as $key => $item) {
$changedItem = \Yii::$app->db->createCommand('select overprice, overprice_type from shop_product_changed_dealer where dealer_item_id=:id',[':id' => $item['id']])->queryOne();
$done++;
if ($done % 1000 == 0) {
gc_collect_cycles();
print_r(memory_get_usage() . "\n");
Console::updateProgress($done, $total);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question