ProductValidityConsole 'product:check-validity'

KFrw
KFrw Developer Posts: 10 🧑🏻‍🚀 - Cadet
public function queryProductsBecomingValid(): SpyProductValidityQuery
{
    return $this
        ->getFactory()
        ->createProductValidityQuery()
        ->filterByValidFrom('now', Criteria::LESS_EQUAL)
        ->filterByValidTo(null, Criteria::ISNULL)
        ->_or()
        ->filterByValidTo('now', Criteria::GREATER_EQUAL);
}

So this selects all products in the end by two queries and kills our system with an OOM…

I guess we now move this to pagination or a queue.

Any other ideas about that?

Answers

  • profuel
    profuel SSA Sprykee Posts: 106 🪐 - Explorer

    Oh, I'm sorry to hear that.

    I think you are talking about this method: \Spryker\Zed\ProductValidity\Business\ProductConcrete\ProductConcreteSwitcher::updateProductsValidity

    It seems to me that you have to implement batching for this method on the project level to handle the numbers of your project.

    I have raised this issue internally.

  • profuel
    profuel SSA Sprykee Posts: 106 🪐 - Explorer

    In order for you to track the progress, please create a support ticket .