File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -11,20 +11,21 @@ class TestActorEvents:
1111 async def test_interval_events (self , make_actor : ActorFactory ) -> None :
1212 async def main () -> None :
1313 import os
14+ from typing import Any , Callable
1415
1516 from apify .consts import ActorEventType , ApifyEnvVars
1617
1718 os .environ [ApifyEnvVars .PERSIST_STATE_INTERVAL_MILLIS ] = '900'
1819
19- def on_event (event_type ): # type: ignore
20- async def log_event (data ): # type: ignore
20+ def on_event (event_type : ActorEventType ) -> Callable :
21+ async def log_event (data : Any ) -> None :
2122 await Actor .push_data ({'event_type' : event_type , 'data' : data })
2223 return log_event
2324
2425 async with Actor :
25- Actor .on (ActorEventType .SYSTEM_INFO , on_event (ActorEventType .SYSTEM_INFO )) # type: ignore
26- Actor .on (ActorEventType .PERSIST_STATE , on_event (ActorEventType .PERSIST_STATE )) # type: ignore
27- await asyncio .sleep (3 )
26+ Actor .on (ActorEventType .SYSTEM_INFO , on_event (ActorEventType .SYSTEM_INFO ))
27+ Actor .on (ActorEventType .PERSIST_STATE , on_event (ActorEventType .PERSIST_STATE ))
28+ await asyncio .sleep (10 )
2829
2930 actor = await make_actor ('actor-interval-events' , main_func = main )
3031
You can’t perform that action at this time.
0 commit comments