Skip to content

v1.7.13

Compare
Choose a tag to compare
@olivermrbl olivermrbl released this 13 Mar 18:16
· 278 commits to master since this release

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