wolfgesbro opened a new issue, #51102:
URL: https://github.com/apache/airflow/issues/51102

   ### Description
   
   My team is using Apprise to send notifications to Matrix from Airflow DAGs. 
We are using [the `apache-airflow-providers-apprise` 
package](https://airflow.apache.org/docs/apache-airflow-providers-apprise/stable/index.html)
 ([source 
code](https://github.com/apache/airflow/tree/main/providers/apprise/src/airflow/providers/apprise)),
 which in our case uses Apprise version 1.9.3.
   
   When sending notifications this way we are quickly running into the login 
rate limit of our Matrix server. When sending these notifications via the 
Apprise CLI, this is not an issue, apparently thanks to [the Persistent Storage 
feature](https://github.com/caronc/apprise/wiki/persistent_storage) which 
caches the login data and avoids frequent re-logins.
   
   Could Apprise's Persistent Storage be activated for the 
`apache-airflow-providers-apprise` package? I have requested and [obtained 
hints for implementing this from the Apprise 
developer](https://github.com/caronc/apprise/issues/1332#issuecomment-2909634835):
   
   > It looks like this issue is in the `AppriseHook()` 
[here](https://github.com/apache/airflow/blob/0e87e058074f50c658edfed18060a4b43228dd69/providers/apprise/src/airflow/providers/apprise/hooks/apprise.py)
   > ```
   > apprise_obj = apprise.Apprise()
   > ```
   > Adjustment would need to be:
   > ```
   > # Prepare a location the persistent storage can write its cached content 
to.
   > # By setting this path, this immediately assumes you wish to operate the
   > # persistent storage in the operational 'auto' mode
   > asset = apprise.AppriseAsset(storage_path="/path/to/save/data")
   > 
   > # alternatively...
   > asset = apprise.AppriseAsset(
   >     # Set our storage path directory (minimum requirement to enable it)
   >     storage_path="/path/to/save/data",
   > 
   >     # Set the mode... the options are:
   >     # 1. PersistentStoreMode.MEMORY
   >     #       - disable persistent storage from writing to disk (default)
   >     # 2. PersistentStoreMode.AUTO
   >     #       - write to disk on demand
   >     # 3. PersistentStoreMode.FLUSH
   >     #       - write to disk always and often
   >     storage_mode=apprise.PersistentStoreMode.FLUSH
   > )
   > 
   > # Now that we've got our asset
   > apprise_obj = apprise.Apprise(asset=asset)
   > ```
   
   
   
   ### Use case/motivation
   
   _No response_
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to