File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -18,17 +18,17 @@ async def main() -> None:
18
18
os .environ [ApifyEnvVars .PERSIST_STATE_INTERVAL_MILLIS ] = '900'
19
19
20
20
was_system_info_emitted = False
21
+ system_infos = []
21
22
22
23
def on_event (event_type : ActorEventTypes ) -> Callable :
23
24
async def log_event (data : Any ) -> None :
24
25
nonlocal was_system_info_emitted
26
+ nonlocal system_infos
25
27
print (f'Got actor event ({ event_type = } , { data = } )' )
26
28
await Actor .push_data ({'event_type' : event_type , 'data' : data })
27
29
if event_type == ActorEventTypes .SYSTEM_INFO :
28
30
was_system_info_emitted = True
29
- # Check that parsing datetimes works correctly
30
- # Check `createdAt` is a datetime (so it's the same locally and on platform)
31
- assert isinstance (data [0 ]['createdAt' ], datetime )
31
+ system_infos .append (data )
32
32
33
33
return log_event
34
34
@@ -43,6 +43,10 @@ async def log_event(data: Any) -> None:
43
43
break
44
44
await asyncio .sleep (1 )
45
45
46
+ # Check that parsing datetimes works correctly
47
+ # Check `createdAt` is a datetime (so it's the same locally and on platform)
48
+ assert isinstance (system_infos [0 ]['createdAt' ], datetime )
49
+
46
50
actor = await make_actor ('actor-interval-events' , main_func = main )
47
51
48
52
run_result = await actor .call ()
You can’t perform that action at this time.
0 commit comments