Skip to content

Commit bfb75d0

Browse files
committed
connect to db immediately
1 parent 47abbbd commit bfb75d0

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

Cargo.lock

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ members = [
44
"core",
55
"cli"
66
]
7+
resolver = "2"
78

89
[workspace.dependencies]
910
nantoka-core = { version = "0.1.0", path = "core"}

app/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ edition = "2021"
88
[dependencies]
99
arrayref = "0.3.7"
1010
async-std = { workspace = true }
11-
relm4 = { version="0.6.1", features = ["libadwaita"] }
12-
relm4-components = "0.6.1"
11+
relm4 = { version="0.6.2", features = ["libadwaita"] }
12+
relm4-components = "0.6.2"
1313
relm4-icons = { version = "0.6.0", features = ["person", "mail-inbox-filled", "desktop-pulse-filled", "plus", "pencil-and-paper", "x-circular", "edit"] }
1414
directories = { workspace = true }
1515
identicon-rs = "4.0.1"

core/src/network/node/worker.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const KADEMLIA_PROTO_NAME: &[u8] = b"/bitmessage/kad/1.0.0";
6060

6161
const MIGRATIONS: Migrator = sqlx::migrate!("src/repositories/sqlite/migrations");
6262
const COMMON_PUBSUB_TOPIC: &'static str = "common";
63-
const POOL_TIMEOUT: Duration = Duration::from_secs(30);
63+
const POOL_TIMEOUT: Duration = Duration::from_secs(5);
6464

6565
#[derive(Debug)]
6666
pub enum Folder {
@@ -234,7 +234,8 @@ impl NodeWorker {
234234
.synchronous(SqliteSynchronous::Normal)
235235
.busy_timeout(POOL_TIMEOUT);
236236

237-
let pool = SqlitePoolOptions::new().connect_lazy_with(connect_options);
237+
let pool = task::block_on(SqlitePoolOptions::new().connect_with(connect_options))
238+
.expect("pool open");
238239

239240
task::block_on(MIGRATIONS.run(&pool)).expect("migrations not to fail");
240241

0 commit comments

Comments
 (0)