Skip to content

Commit 42ae432

Browse files
committed
Use connect_now in syncing categories
1 parent 4bffbfb commit 42ae432

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/categories.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Runs when the server is started.
33

44
use toml;
5-
use pg;
6-
use env;
5+
6+
use db;
77
use util::errors::{CargoResult, ChainError, internal};
88

99
struct Category {
@@ -80,8 +80,7 @@ fn categories_from_toml(categories: &toml::Table, parent: Option<&Category>) ->
8080
}
8181

8282
pub fn sync() -> CargoResult<()> {
83-
let conn = pg::Connection::connect(&env("DATABASE_URL")[..],
84-
pg::TlsMode::None).unwrap();
83+
let conn = db::connect_now();
8584
let tx = conn.transaction().unwrap();
8685

8786
let categories = include_str!("./categories.toml");

0 commit comments

Comments
 (0)