Replies: 3 comments 3 replies
-
Have you tried using the TransactionMode setting of the |
Beta Was this translation helpful? Give feedback.
-
Yes. It works like that. However, I notice that there are still a lot of I think the debounce makes the event trigger after the buffer has been flushed. It's hard to figure out why, but I'm still getting around 500 |
Beta Was this translation helpful? Give feedback.
-
I'm getting these errors I'm creating a buffer when importing a batch of products, however, the method gets called multiple times simultaneously. Not sure if this is the intended usage of buffers, but in any case, I thought it worth mentioning. |
Beta Was this translation helpful? Give feedback.
-
I didn't want to create a ticket right away because this is more of a design issue than a bug. However, it does present a problem. Consider the following code:
Jobs like
update-search-index
andapply-collection-filters
are created when a ProductEvent or a ProductVariant event is observed. However, with the latest changes, these won't be triggered until the transaction commits. However, the transaction commits after the buffer is flushed because it's a wrapper around the entire controller method.My solution to this is to create my own transaction wrapper which creates its own RequestContext, which is needed to use the internal Vendure services. I think that Vendure should provide a finer-grained tool for executing transactions with the current RequestContext, since it contains valuable information.
Beta Was this translation helpful? Give feedback.
All reactions