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

Improve Persistence #1827

Merged
merged 4 commits into from
Apr 10, 2020
Merged

Improve Persistence #1827

merged 4 commits into from
Apr 10, 2020

Conversation

Bibo-Joshi
Copy link
Member

Originally intended to close #1671 , this now does 3 things:

  1. Unify the two methods of dispatcher used to update the persistence. This makes sure that
    1. If persistence is updated after handling an update, only the corresponding user/chat_data is updated
    2. Errors that appear when updating persistence on shutting down the bot will be handled correctly
  2. Fixing a minor bug in Pickle/DictPersistence: When calling update_*_data before calling get_*_data, we need to check that the internal attributes are not None
  3. Actually close [FEATURE] Persistence inside of Jobs #1671 by updating the persistence after running a job

@Bibo-Joshi
Copy link
Member Author

Bibo-Joshi commented Mar 10, 2020

CI:

  • Py3.7 fails on test_game_score. Unrelated
  • Codecov mainly complains that the parts
'Saving user data raised an error and an ' \
'uncaught error was raised while handling ' \
'the error with an error_handler'

are not tested. But as far as I can see, they weren't tested before …
Added corresponding tests b/c more coverage = more better 🤸‍♂

Copy link
Member

@Poolitzer Poolitzer left a comment

Choose a reason for hiding this comment

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

LGTM

telegram/ext/dispatcher.py Show resolved Hide resolved
@Bibo-Joshi Bibo-Joshi merged commit f379f54 into master Apr 10, 2020
@Bibo-Joshi Bibo-Joshi deleted the job-persistence branch April 10, 2020 11:23
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Persistence inside of Jobs
2 participants