-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Akka.Persistence: Made DateTime.UtcNow
the default timestamp for SnapshotMetdata
#7313
Changes from 3 commits
333b5c2
930414f
788111a
28b94b5
64b00ed
736d3b8
6851492
85c143a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -587,7 +587,8 @@ namespace Akka.Persistence | |
} | ||
public sealed class SnapshotMetadata : System.IEquatable<Akka.Persistence.SnapshotMetadata> | ||
{ | ||
public static System.DateTime TimestampNotSpecified; | ||
[System.ObsoleteAttribute("This constructor is deprecated and will be removed in v1.6. Use the constructor w" + | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A little nitpick, Would be better if we follow english language sentence breaking point here, makes it easier to read. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point - I can fix that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, no I can't - that's an artifact from the rendering of the API diff. The real code looks like this: [Obsolete("This constructor is deprecated and will be removed in v1.6. Use the constructor with the timestamp parameter instead.", true)] |
||
"ith the timestamp parameter instead.", true)] | ||
public SnapshotMetadata(string persistenceId, long sequenceNr) { } | ||
[Newtonsoft.Json.JsonConstructorAttribute()] | ||
public SnapshotMetadata(string persistenceId, long sequenceNr, System.DateTime timestamp) { } | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -247,7 +247,7 @@ protected IActorRef WriteSnapshot(string persistenceId, int n) | |
ExpectMsg($"{persistenceId}-{i}-done"); | ||
} | ||
|
||
var metadata = new SnapshotMetadata(persistenceId, n + 10); | ||
var metadata = new SnapshotMetadata(persistenceId, n + 10, Sys.Scheduler.Now.DateTime); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Standard call we're going to use to get the current UTC time from the |
||
SnapshotStore.Tell(new SaveSnapshot(metadata, $"s-{n}"), _senderProbe.Ref); | ||
_senderProbe.ExpectMsg<SaveSnapshotSuccess>(); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -218,7 +218,7 @@ public void LoadSnapshot(string persistenceId, SnapshotSelectionCriteria criteri | |
/// <param name="snapshot">TBD</param> | ||
public void SaveSnapshot(object snapshot) | ||
{ | ||
SnapshotStore.Tell(new SaveSnapshot(new SnapshotMetadata(SnapshotterId, SnapshotSequenceNr), snapshot)); | ||
SnapshotStore.Tell(new SaveSnapshot(new SnapshotMetadata(SnapshotterId, SnapshotSequenceNr, Context.System.Scheduler.Now.Date), snapshot)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using the same standard call now for both saving and deleting snapshots - big question I have though: does this break deleting snapshots? It SHOULDN'T, but we'll need to see how the specs perform to know for certain. |
||
} | ||
|
||
/// <summary> | ||
|
@@ -230,7 +230,7 @@ public void SaveSnapshot(object snapshot) | |
/// <param name="sequenceNr">TBD</param> | ||
public void DeleteSnapshot(long sequenceNr) | ||
{ | ||
SnapshotStore.Tell(new DeleteSnapshot(new SnapshotMetadata(SnapshotterId, sequenceNr))); | ||
SnapshotStore.Tell(new DeleteSnapshot(new SnapshotMetadata(SnapshotterId, sequenceNr, DateTime.MinValue))); | ||
} | ||
|
||
/// <summary> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just marked the old CTOR as
Obsolete
- no other API changes.