Refactored configuration + cache support added #175
Merged
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.
Description:
Re-factored some of the AppriseConfig class to additionally support the
cache=
directive similar to how it works with Attachments. The idea is now you can tell Apprise not to cache the configuration files (which will cause them to retrieved each request made). This provides a more dynamic solution allowing your configuration to change while Apprise has already been loaded in memory.For web requests, you can set things like
cache=30
which will keep the last retrieved remote content for 30 seconds. All requests made within this time period will use the same configuration retrieved from that one remote request. After 30 seconds (in the case of this example) a new remote fetch for configuration is made (renewing it).The default option is
cache=Yes
which causes Apprise to continue to behave as it had in the past; after a remote request for configuration has been made, it is re-used for the entire life of the program; no further requests are made.You can also set
cache=No
to disable caching all together. This has a bit of overhead involved; but this might be your intention. Apprise URLs are queried from configuration files (regardless of where they are) each and every time.Checklist
flake8
)