Skip to content

Commit 67c6b32

Browse files
fixed bug with IPersistentRepresentation.Update and timestamp propagation (#4684)
* moved DateTimes to Utc to make them monotonic
1 parent be43227 commit 67c6b32

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/contrib/persistence/Akka.Persistence.Sql.Common/Journal/BatchingSqlJournal.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1210,7 +1210,7 @@ private async Task HandleWriteMessages(WriteMessages req, TCommand command)
12101210
persistent = persistent.WithPayload(tagged.Payload);
12111211
}
12121212

1213-
WriteEvent(command, persistent.WithTimestamp(DateTime.Now.Ticks), tagBuilder.ToString());
1213+
WriteEvent(command, persistent.WithTimestamp(DateTime.UtcNow.Ticks), tagBuilder.ToString());
12141214

12151215
await command.ExecuteNonQueryAsync();
12161216

src/contrib/persistence/Akka.Persistence.Sql.Common/Journal/QueryExecutor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ public virtual async Task InsertBatchAsync(DbConnection connection, Cancellation
684684
var evt = entry.Key;
685685
var tags = entry.Value;
686686

687-
WriteEvent(command, evt.WithTimestamp(DateTime.Now.Ticks), tags);
687+
WriteEvent(command, evt.WithTimestamp(DateTime.UtcNow.Ticks), tags);
688688
await command.ExecuteScalarAsync(cancellationToken);
689689
command.Parameters.Clear();
690690
}

0 commit comments

Comments
 (0)