Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Use StateResolutionHandler to resolve state in persist_events #2864

Merged
merged 5 commits into from Feb 13, 2018

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Feb 13, 2018

... and thus benefit (hopefully) from its cache.

# I don't think this can happen, but let's double-check
raise Exception(
"Context for new extremity event %s has no state "
"group" % event_id,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I do prefer always using tuples rather than relying on strings working.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as in you'd prefer (event_id, ) ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally yes, (or (event_id,) without the space), as its very confusing if there is a bug and event_id suddenly becomes iterable and then the logging explodes. In this particular case its probably fine though

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair

@@ -586,6 +586,7 @@ def get_events(ev_ids):

current_state = yield resolve_events_with_factory(
state_sets,
event_map={},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be None to be a bit more consistent?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plausibly, but it's replaced in ebfe64e anyway

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, didn't realise until after i had submitted the review

@richvdh richvdh merged commit bfdf7b9 into develop Feb 13, 2018
@richvdh richvdh deleted the rav/persist_event_caching branch February 13, 2018 14:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants