Fix time in AtLeastOnce.setDeliverySnapshot, #27786

* to be consistent with internalDeliver when recoveryRunning
This commit is contained in:
Patrik Nordwall 2020-09-01 12:08:02 +02:00
parent 4249b02c40
commit cd8d5c5d08

View file

@ -361,7 +361,8 @@ trait AtLeastOnceDeliveryLike extends Eventsourced {
*/
def setDeliverySnapshot(snapshot: AtLeastOnceDeliverySnapshot): Unit = {
deliverySequenceNr = snapshot.currentDeliveryId
val now = System.nanoTime()
// deliver on next tick
val now = System.nanoTime() - redeliverInterval.toNanos
unconfirmed = scala.collection.immutable.SortedMap.from(snapshot.unconfirmedDeliveries.iterator.map(d =>
d.deliveryId -> Delivery(d.destination, d.message, now, 0)))
}