removes part of serializer for serializing start and stop methods of async methods

This commit is contained in:
Mose Müller 2024-08-20 08:29:00 +02:00
parent d1d2ac2614
commit 416b9ee815

View File

@ -295,16 +295,6 @@ class Serializer:
if key.startswith("_"):
continue # Skip attributes that start with underscore
# Skip keys that start with "start_" or "stop_" and end with an async
# method name
if key.startswith(("start_", "stop_")) and key.split("_", 1)[1] in {
name
for name, _ in inspect.getmembers(
obj, predicate=inspect.iscoroutinefunction
)
}:
continue
val = getattr(obj, key)
path = f"{access_path}.{key}" if access_path else key