Updated Troubleshooting (markdown)

master
Chris Caron 2022-07-06 09:00:48 -04:00
parent e9193d15d4
commit 3e281ee2b7
1 changed files with 21 additions and 0 deletions

@ -8,6 +8,9 @@
* [Special Characters and URL Conflicts](#special-characters-and-url-conflicts)
* [Formatting Issues](#formatting-issues)
* [PyInstaller Support](#pyinstaller-support)
* [General Exceptions and/or Messages](#general-exceptions-andor-messages)
* [RuntimeError: asyncio.run() cannot be called from a running event loop
](https://github.com/caronc/apprise/wiki/Troubleshooting/_edit#runtimeerror-asynciorun-cannot-be-called-from-a-running-event-loop)
<!--te-->
## General Troubleshooting
@ -233,3 +236,21 @@ pyinstaller -F --collect-all apprise myscript.py
No more errors, notifications are sent.
## General Exceptions and/or Messages
### RuntimeError: asyncio.run() cannot be called from a running event loop
If your calling program runs it's own event loop, then Apprise can cause some commotion when it tries to work with it's own. For these circumstances you have 2 options.
1. Do not call `notify()`. Instead `await` the `async_notify()` call itself. [See here for more details](https://github.com/caronc/apprise/wiki/Development_API#async_notify--leveraging-await-to-send-notifications).
1. Leverage a library that handles this exact case called [nest-asyncio](https://pypi.org/project/nest-asyncio/):
```bash
pip install nest-asyncio
```
Then from within your python application just import it at the top:
```python
import nest_asyncio
# apply it
nest_asyncio.apply()
```
An issue related to FastCGI was brought forth [here](https://github.com/caronc/apprise/issues/610) and solved using this method.