fix clock implementation for OPFS IO

This commit is contained in:
Nikita Sivukhin
2025-09-19 13:17:23 +04:00
parent bc2dbe9025
commit 7049f3ddae
6 changed files with 9 additions and 9 deletions

View File

@@ -16,6 +16,7 @@ napi = { version = "3.1.3", default-features = false, features = ["napi6"] }
napi-derive = { version = "3.1.1", default-features = true }
tracing-subscriber = { workspace = true, features = ["env-filter"] }
tracing.workspace = true
chrono = { workspace = true, default-features = false, features = ["clock"] }
[features]
encryption = ["turso_core/encryption"]

View File

@@ -140,7 +140,11 @@ impl Opfs {
impl Clock for Opfs {
fn now(&self) -> Instant {
Instant { secs: 0, micros: 0 } // TODO
let now = chrono::Local::now();
Instant {
secs: now.timestamp(),
micros: now.timestamp_subsec_micros(),
}
}
}

View File

@@ -12,8 +12,6 @@
#[cfg(feature = "browser")]
pub mod browser;
#[cfg(feature = "browser")]
use crate::browser::opfs;
use napi::bindgen_prelude::*;
use napi::{Env, Task};

View File

@@ -10,7 +10,6 @@ repository.workspace = true
crate-type = ["cdylib"]
[dependencies]
http = "1.3.1"
napi = { version = "3.1.3", default-features = false, features = ["napi6"] }
napi-derive = { version = "3.1.1", default-features = true }
turso_sync_engine = { workspace = true }