Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, pretix data is fetched regularly and kept in memory. When the bot is restarted, all pretix data has to be fetched again, so if we restart the bot while pretix is offline, no registrations are possible.
The PR adds caching of Pretix data in a local file, which is used when the bot is starting up.
Implementation: On each successful pretix data fetch, all in-memory pretix data is written to the persistent file
pretix_cache.json
. On bot startup, the content of this file is used as initial state before the first successful pretix fetch occurred.Details:
Ticket
fromdataclasses.dataclass
topydantic.BaseModel
to simplify JSON de-/serialization.pretix.PRETIX_CACHE_FILE
pretix_cache.json
to .gitignore, ansible playbook, docker-compose