copy background task marker (#3255)
This commit is contained in:
parent
bdcbe006a2
commit
38c46ec4d5
@ -39,6 +39,7 @@ from redis.asyncio import Redis
|
|||||||
from reflex import constants
|
from reflex import constants
|
||||||
from reflex.base import Base
|
from reflex.base import Base
|
||||||
from reflex.event import (
|
from reflex.event import (
|
||||||
|
BACKGROUND_TASK_MARKER,
|
||||||
Event,
|
Event,
|
||||||
EventHandler,
|
EventHandler,
|
||||||
EventSpec,
|
EventSpec,
|
||||||
@ -579,6 +580,8 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow):
|
|||||||
closure=fn.__closure__,
|
closure=fn.__closure__,
|
||||||
)
|
)
|
||||||
newfn.__annotations__ = fn.__annotations__
|
newfn.__annotations__ = fn.__annotations__
|
||||||
|
if mark := getattr(fn, BACKGROUND_TASK_MARKER, None):
|
||||||
|
setattr(newfn, BACKGROUND_TASK_MARKER, mark)
|
||||||
return newfn
|
return newfn
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
Loading…
Reference in New Issue
Block a user