Merge pull request #29539 from akka/wip-27786-setDeliverySnapshot-patriknw

Fix time in AtLeastOnce.setDeliverySnapshot, #27786
This commit is contained in:
Patrik Nordwall 2020-09-07 15:15:47 +02:00 committed by GitHub
commit 6becd8e0ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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)))
}