github medusajs/medusa v1.7.13

latest releases: v2.0.1, @medusajs/workflow-engine-redis@2.0.1, @medusajs/workflow-engine-inmemory@2.0.1...
20 months ago

Features

Bulk emit events
This release contains an improvement of the events system in Medusa. We've updated the EventBusService.emit method to now support bulk emitting a collection of events. This is useful in bulk upsert scenarios and significantly improves performance.

Note, these changes are backward compatible so that you can use emit to send a single event, as usual.

Single emit

await eventBusService.emit("product.created", { id: product.id }, { attempts: 4 })

Bulk emit

let events = [
  {
    eventName: "product.created",
    data: { id: product.id }
    opts: { attempts: 5 }
  }, 
  {
    eventName: "product.created",
    data: { id: product2.id }
    opts: { attempts: 3 }
  }
]

await eventBusService.emit(events)

Chore

  • chores(medusa): Improve draft order creation perf flow (#3431) @adrien2p

Don't miss a new medusa release

NewReleases is sending notifications on new releases.