mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-12-26 00:59:22 -05:00
Fix ModuleApi.looping_background_call
for non-async functions (#11524)
After #10847, `looping_background_call` would print an error in the logs every time a non-async function was called. Since the error would be caught and ignored immediately, there were no other side effects.
This commit is contained in:
parent
b1ecd19c5d
commit
eccc49d755
1
changelog.d/11524.bugfix
Normal file
1
changelog.d/11524.bugfix
Normal file
@ -0,0 +1 @@
|
|||||||
|
Fix a regression in Synapse 1.48.0 where the module API's `looping_background_call` method would spam errors to the logs when given a non-async function.
|
@ -108,6 +108,7 @@ from synapse.types import (
|
|||||||
create_requester,
|
create_requester,
|
||||||
)
|
)
|
||||||
from synapse.util import Clock
|
from synapse.util import Clock
|
||||||
|
from synapse.util.async_helpers import maybe_awaitable
|
||||||
from synapse.util.caches.descriptors import cached
|
from synapse.util.caches.descriptors import cached
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
@ -1014,9 +1015,7 @@ class ModuleApi:
|
|||||||
run_as_background_process,
|
run_as_background_process,
|
||||||
msec,
|
msec,
|
||||||
desc,
|
desc,
|
||||||
f,
|
lambda: maybe_awaitable(f(*args, **kwargs)),
|
||||||
*args,
|
|
||||||
**kwargs,
|
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
logger.warning(
|
logger.warning(
|
||||||
|
Loading…
Reference in New Issue
Block a user