Calling Developers!
We are reenergizing our code contribution process! Learn More

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, improving the import speed we want to temporary deactivate the events using the EventBehavio

Options
UPWG9AYH2
UPWG9AYH2 Posts: 509 🧑🏻‍🚀 - Cadet

Hello,
improving the import speed we want to temporary deactivate the events using the EventBehaviourConfig:disable() like done on demo data import from spryker and call it after the import once … however, it seems there are events on event/publish queue anyway despite the eventbehaviour is deactivated. Having a closer look it seems that there are implicit calls of the (legacy?) touch facade like for the avalability module when updating the availibility via facade.
Is there a way to also deactivate the touch facade to not produce events?
Best

Comments

  • UPWG9AYH2
    UPWG9AYH2 Posts: 509 🧑🏻‍🚀 - Cadet
    Options

    The cause seems no to be the touch facade … but within the AvailabilityHandler the
    saveAndTouchAvailability() methods

    $this->eventFacade->trigger(
    AvailabilityEvents::AVAILABILITY_NOTIFICATION,
    $availabilityNotificationDataTransfer
    );

    Seems to bypass the EventBehaviourEventConfig that actually says disableEvent() were i expect, no event is fired … do i miss something?🤔

  • UPWG9AYH2
    UPWG9AYH2 Posts: 509 🧑🏻‍🚀 - Cadet
    edited September 2021
    Options

    Seems its the nature of itself … deactivating the event behaviour only applies to events generated on propel level … but it seems that some (or almost every) facade has somewhere an explicit call to eventfacade which will trigger the event no matter what config in EventBahviourConfig is set. I guess there is no chance except switching to propel level instead of using facades to insert data

  • U013EK8RD7A
    U013EK8RD7A Posts: 127 🧑🏻‍🚀 - Cadet
    Options

    Yes, facades should be avoided in imports when writing data. Unless that specific facade method does plain writing, but thats a pretty rare case.