@@ -28,7 +28,11 @@ use serde::{Deserialize, Serialize};
28
28
use serde_json:: Value ;
29
29
use std:: collections:: { BTreeSet , HashMap } ;
30
30
use std:: sync:: { Arc , RwLock } ;
31
+ #[ cfg( not( target_arch = "wasm32" ) ) ]
32
+ use std:: time:: Instant ;
31
33
use uuid:: Uuid ;
34
+ #[ cfg( target_arch = "wasm32" ) ]
35
+ use web_time:: Instant ;
32
36
33
37
pub const SUBSCRIPTION_TIMESTAMP : & str = "subscription_timestamp" ;
34
38
pub const KEYCHAIN_STORE_KEY : & str = "bdk_keychain" ;
@@ -241,7 +245,7 @@ pub trait MutinyStorage: Clone + Sized + Send + Sync + 'static {
241
245
}
242
246
243
247
// save to VSS by spawn an async task
244
- log_debug ! ( self . logger( ) , "writing to VSS" ) ;
248
+ log_debug ! ( self . logger( ) , "writing to VSS {:?}" , key ) ;
245
249
if let Some ( cb) = self . ln_event_callback ( ) . as_ref ( ) {
246
250
let event = CommonLnEvent :: SyncToVssStarting {
247
251
key : key. clone ( ) ,
@@ -250,7 +254,7 @@ pub trait MutinyStorage: Clone + Sized + Send + Sync + 'static {
250
254
} ;
251
255
cb. trigger ( event) ;
252
256
}
253
- let start = std :: time :: Instant :: now ( ) ;
257
+ let start = Instant :: now ( ) ;
254
258
self . spawn ( {
255
259
let db = self . clone ( ) ;
256
260
let logger = self . logger ( ) . clone ( ) ;
@@ -259,7 +263,8 @@ pub trait MutinyStorage: Clone + Sized + Send + Sync + 'static {
259
263
let duration = start. elapsed ( ) ;
260
264
log_debug ! (
261
265
logger,
262
- "done writing to VSS, took {:?}" ,
266
+ "done writing to VSS {:?}, took {:?}ms" ,
267
+ key,
263
268
duration. as_millis( )
264
269
) ;
265
270
if let Some ( cb) = db. ln_event_callback ( ) . as_ref ( ) {
0 commit comments