the data some times is written before async operations are finished. This can cause bugs for example: create group -> delete group -> channels are not always removed, as the channel id was returned from discord after writing finished. I'm not 100% sure if this error can be reproduced easily, but I made the wrapper aware of async functions. Not sure if this is the best way though:
def save_yaml(original_function):
@wraps(original_function)
def wrapper(*args, **kwargs):
result = original_function(*args, **kwargs)
write_yaml()
return result
@wraps(original_function)
async def async_wrapper(*args, **kwargs):
result = await original_function(*args, **kwargs)
write_yaml()
return result
if asyncio.iscoroutinefunction(original_function):
return async_wrapper
else:
return wrapper
the data some times is written before async operations are finished. This can cause bugs for example: create group -> delete group -> channels are not always removed, as the channel id was returned from discord after writing finished. I'm not 100% sure if this error can be reproduced easily, but I made the wrapper aware of async functions. Not sure if this is the best way though:
will be added to #77