mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-25 20:14:21 +01:00
fix clock implementation for OPFS IO
This commit is contained in:
@@ -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"]
|
||||
|
||||
@@ -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(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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};
|
||||
|
||||
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user