Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

arcadiushmcts
Copy link

No description provided.

@arcadiushmcts arcadiushmcts force-pushed the dev/generate-snapshot-in-background branch 7 times, most recently from 575de73 to 1f65183 Compare November 18, 2024 14:48
@arcadiushmcts arcadiushmcts force-pushed the dev/generate-snapshot-in-background branch from 1f65183 to 03bcb66 Compare November 18, 2024 15:14
Copy link

sonarcloud bot commented Nov 18, 2024

logger.debug("Stored successfully {}", storedSuccessfully);
return storedSuccessfully;
} catch (SerializationException e) {
logger.error("Error creating snapshot for %s".formatted(streamId), e);
Copy link
Member

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);
Copy link
Member

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) {
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants