mirror of
https://github.com/iio612/DEFENDER.git
synced 2026-02-13 11:14:23 +00:00
Introduce full asyncio version (still some module to migrate). Defender JSONRPC Server ready and using with uvcorn
This commit is contained in:
@@ -13,6 +13,7 @@ from time import time
|
||||
from random import choice
|
||||
from hashlib import md5, sha3_512
|
||||
from core.classes.modules.settings import global_settings
|
||||
from asyncio import iscoroutinefunction
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from core.irc import Irc
|
||||
@@ -243,3 +244,14 @@ def hide_sensitive_data(srvmsg: list[str]) -> list[str]:
|
||||
|
||||
except ValueError:
|
||||
return srvmsg
|
||||
|
||||
def is_coroutinefunction(func: Any) -> bool:
|
||||
"""Check if the function is a coroutine or not
|
||||
|
||||
Args:
|
||||
func (Any): an callable object
|
||||
|
||||
Returns:
|
||||
bool: True if the function is a coroutine
|
||||
"""
|
||||
return iscoroutinefunction(func)
|
||||
Reference in New Issue
Block a user