Add comment
This commit is contained in:
parent
6b23195385
commit
6c4aca1657
1 changed files with 6 additions and 2 deletions
|
|
@ -69,8 +69,12 @@ trait AsyncWriteJournal extends Actor with WriteJournalBase with AsyncRecovery {
|
|||
val atomicWriteCount = messages.count(_.isInstanceOf[AtomicWrite])
|
||||
val prepared = Try(preparePersistentBatch(messages))
|
||||
val writeResult = (prepared match {
|
||||
case Success(prep) if prep.isEmpty => Future.successful(Nil)
|
||||
case Success(prep) =>
|
||||
case Success(prep) if prep.isEmpty =>
|
||||
// prep is empty when all messages are instances of NonPersistentRepr (used for defer) in that case,
|
||||
// we continue right away without calling the journal plugin (most plugins fail calling head on empty Seq).
|
||||
// Ordering of the replies is handled by Resequencer
|
||||
Future.successful(Nil)
|
||||
case Success(prep) =>
|
||||
// try in case the asyncWriteMessages throws
|
||||
try breaker.withCircuitBreaker(asyncWriteMessages(prep))
|
||||
catch { case NonFatal(e) => Future.failed(e) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue