@@ -11,7 +11,7 @@ use std::convert::{Infallible, Into};
11
11
use std:: io:: Write ;
12
12
use std:: time:: Duration ;
13
13
use tracing:: metadata:: LevelFilter ;
14
- use tracing:: { info , Dispatch , Level , Subscriber } ;
14
+ use tracing:: { Dispatch , Level , Subscriber } ;
15
15
use tracing_subscriber:: fmt:: format:: FmtSpan ;
16
16
use tracing_subscriber:: fmt:: MakeWriter ;
17
17
use tracing_subscriber:: layer:: SubscriberExt ;
@@ -410,6 +410,9 @@ impl WasmVM {
410
410
Some ( Value :: CombinatorResult ( handles) ) => WasmAsyncResultValue :: CombinatorResult (
411
411
handles. into_iter ( ) . map ( Into :: into) . collect ( ) ,
412
412
) ,
413
+ _ => {
414
+ panic ! ( "Unsupported yet" )
415
+ }
413
416
} ,
414
417
)
415
418
}
@@ -456,9 +459,11 @@ impl WasmVM {
456
459
}
457
460
458
461
pub fn sys_sleep ( & mut self , millis : u64 ) -> Result < WasmAsyncResultHandle , WasmFailure > {
462
+ let now = now_since_unix_epoch ( ) ;
459
463
use_log_dispatcher ! ( self , |vm| CoreVM :: sys_sleep(
460
464
vm,
461
- duration_since_unix_epoch( ) + Duration :: from_millis( millis)
465
+ now + Duration :: from_millis( millis) ,
466
+ Some ( now)
462
467
) )
463
468
. map ( Into :: into)
464
469
. map_err ( Into :: into)
@@ -477,6 +482,8 @@ impl WasmVM {
477
482
service,
478
483
handler,
479
484
key,
485
+ idempotency_key: None ,
486
+ headers: vec![ ] ,
480
487
} ,
481
488
buffer. to_vec( ) . into( )
482
489
) )
@@ -498,10 +505,13 @@ impl WasmVM {
498
505
service,
499
506
handler,
500
507
key,
508
+ idempotency_key: None ,
509
+ headers: vec![ ] ,
501
510
} ,
502
511
buffer. to_vec( ) . into( ) ,
503
- delay. map( |delay| duration_since_unix_epoch ( ) + Duration :: from_millis( delay) )
512
+ delay. map( |delay| now_since_unix_epoch ( ) + Duration :: from_millis( delay) )
504
513
) )
514
+ . map ( |_| ( ) )
505
515
. map_err ( Into :: into)
506
516
}
507
517
@@ -826,7 +836,7 @@ impl AsyncResultCombinator for AllSettledAsyncResultCombinator {
826
836
}
827
837
}
828
838
829
- fn duration_since_unix_epoch ( ) -> Duration {
839
+ fn now_since_unix_epoch ( ) -> Duration {
830
840
Duration :: from_millis ( js_sys:: Date :: now ( ) as u64 )
831
841
}
832
842
0 commit comments