-
Notifications
You must be signed in to change notification settings - Fork 3
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
generate snapshot in background #364
base: master
Are you sure you want to change the base?
Conversation
575de73
to
1f65183
Compare
1f65183
to
03bcb66
Compare
Quality Gate passedIssues Measures |
logger.debug("Stored successfully {}", storedSuccessfully); | ||
return storedSuccessfully; | ||
} catch (SerializationException e) { | ||
logger.error("Error creating snapshot for %s".formatted(streamId), e); |
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.
Didn't know you could do this kind of formatting. Nice :-)
@@ -26,7 +26,7 @@ public class AggregateSnapshotTest { | |||
public void shouldCreateAnAggregateSnapshot() throws Exception { | |||
final TestAggregate aggregate = new TestAggregate("STATE1"); | |||
|
|||
final AggregateSnapshot<TestAggregate> snapshot = new AggregateSnapshot<>(STREAM_ID, VERSION_ID, aggregate); | |||
final AggregateSnapshot<TestAggregate> snapshot = new AggregateSnapshot<>(STREAM_ID, VERSION_ID, aggregate, null); |
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.
I'm not sure I like passing in null like this. I've found nulls usually lead to tears and pain. Can this be an Optional instead?
} | ||
|
||
public AggregateSnapshot(final UUID streamId, final Long versionId, final String type, final byte[] aggregateByteRepresentation) { | ||
public AggregateSnapshot(final UUID streamId, final Long versionId, final String type, final byte[] aggregateByteRepresentation, final ZonedDateTime createdAt) { |
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.
If the aggregateByteRepresentation byte array and createdAt date are linked, should they be but into a new single Object, AggregateByteArray or something. Also, if it's not always been created, should that Object be Optional?
No description provided.