What are the Slack Archives?

Itโ€™s a history of our time together in the Slack Community! Thereโ€™s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you wonโ€™t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hello, I need to label lot of products. I used Spryker's label feature and added `ProductLabelRelati

USZB5JN4W
USZB5JN4W Posts: 112 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

Hello, I need to label lot of products. I used Spryker's label feature and added ProductLabelRelationUpdaterPluginInterface , but it's launched every minute and this can be a bit problematic with big amount of products. Does Spryker have other possibility to add/remove label on product save?

Comments

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Lรถffelhardt Spryker Solution Partner Posts: 871 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    Hi, how much products do u have? and how much do u think have to be labeled in average?

  • USZB5JN4W
    USZB5JN4W Posts: 112 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    few thousands (with inactive products), but later it can increase

  • USZB5JN4W
    USZB5JN4W Posts: 112 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    I'm thinking about using ProductAbstractPluginUpdateInterface , but looks like ProductLabelRelationUpdaterPluginInterface is "spryker way"

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Lรถffelhardt Spryker Solution Partner Posts: 871 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    Ok, it is not a problem with standard code/beahviour from spryker..
    we have ca. 3 Mio and we have just a couple of optimization (with spryker together) and everything is works fine..

    The job take max. 1 min to terminate our job calculation..

  • USZB5JN4W
    USZB5JN4W Posts: 112 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    hmm could you tell, which optimizations have you done? ๐Ÿ™‚

  • USZB5JN4W
    USZB5JN4W Posts: 112 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    i mean for now it works ok, but i'm little worried, because ProductLabelRelationUpdaterPluginInterface is launched by cron (jenkins) every minute

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Lรถffelhardt Spryker Solution Partner Posts: 871 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    of course... we have a lot of product discontinued and it was a bottleneck performance problem and also memory allocation problem..

    We have in \Pyz\Zed\ProductDiscontinuedProductLabelConnector\Persistence\ProductDiscontinuedProductLabelConnectorRepository::getProductAbstractIdsToBeLabeled the function in pyz level overrided so: (there are no other possibilities than plain query due limitation of propel)

    /**
         * @module Product
         * @module ProductDiscontinued
         *
         * @return int[]
         */
        public function getProductAbstractIdsToBeLabeled(): array
        {
            $productAbstractWithNotDiscontinuedProductConcreteSubQuery = '
                SELECT ' . SpyProductTableMap::COL_FK_PRODUCT_ABSTRACT . '
                FROM ' . SpyProductTableMap::TABLE_NAME . '
                LEFT JOIN ' . SpyProductDiscontinuedTableMap::TABLE_NAME . '
                    ON (' . SpyProductTableMap::COL_ID_PRODUCT . ' = ' . SpyProductDiscontinuedTableMap::COL_FK_PRODUCT . ')
                WHERE ' . SpyProductDiscontinuedTableMap::COL_ID_PRODUCT_DISCONTINUED . ' IS NULL';
    
            return $this->getFactory()
                ->getProductPropelQuery()
                ->where(SpyProductTableMap::COL_FK_PRODUCT_ABSTRACT . ' NOT IN (' . $productAbstractWithNotDiscontinuedProductConcreteSubQuery . ')')
                ->distinct()
                ->select([SpyProductTableMap::COL_FK_PRODUCT_ABSTRACT])
                ->find()
                ->toArray();
        }
    

    This is just a patch that we applied on pyz level and it works very good.

  • USZB5JN4W
    USZB5JN4W Posts: 112 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    will check this. Thanks ๐Ÿ™‚