asyncio.run() cannot be called from a running event loop
- Dominant language
- Python
- Stars
- 133k
- Forks
- 15.7k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 155
Description
### Custom Node Testing
- [x] I have tried disabling custom nodes and the issue persists (see [how to disable custom nodes](https://docs.comfy.org/troubleshooting/custom-node-issues#step-1%3A-test-with-all-custom-nodes-disabled) if you need help)
### Expected Behavior
run a async function
### Actual Behavior
RuntimeError: asyncio.run() cannot be called from a running event loop
### Steps to Reproduce
async def dosomething()
print("hello")
await asyncio.sleep(1)
print("world")
FUNCTION = "node_function"
def node_function(self, string,):
asyncio.run(dosomething())
return ("",)
### Debug Logs
```powershell
File "C:\Users\MyPC\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 191, in run
raise RuntimeError(
RuntimeError: asyncio.run() cannot be called from a running event loop
```
### Other
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.