Upgraded diesel to 0.99 and switched from the git master into crated.io.
Also did a cargo upgrade of all the dependancies. Notable upgrades are r2d2, lazystatic 1.0, loggerv 0.6 and rss 1.2
This commit is contained in:
@@ -8,24 +8,24 @@ workspace = "../"
|
||||
chrono = "0.4.0"
|
||||
dotenv = "0.10.1"
|
||||
error-chain = "0.11.0"
|
||||
lazy_static = "0.2.11"
|
||||
lazy_static = "1.0.0"
|
||||
log = "0.3.8"
|
||||
r2d2 = "0.7.4"
|
||||
r2d2-diesel = "0.16.0"
|
||||
r2d2 = "0.8.1"
|
||||
r2d2-diesel = "0.99.0"
|
||||
rayon = "0.9.0"
|
||||
reqwest = "0.8.1"
|
||||
rfc822_sanitizer = "0.3.3"
|
||||
rss = "1.1.0"
|
||||
rss = "1.2.1"
|
||||
url = "1.6.0"
|
||||
xdg = "2.1.0"
|
||||
|
||||
[dependencies.diesel]
|
||||
features = ["sqlite"]
|
||||
git = "https://github.com/diesel-rs/diesel.git"
|
||||
version = "0.99.0"
|
||||
|
||||
[dependencies.diesel_codegen]
|
||||
[dependencies.diesel_migrations]
|
||||
features = ["sqlite"]
|
||||
git = "https://github.com/diesel-rs/diesel.git"
|
||||
version = "0.99.0"
|
||||
|
||||
[dev-dependencies]
|
||||
rand = "0.3.18"
|
||||
|
||||
@@ -5,7 +5,6 @@ use r2d2;
|
||||
use std::path::PathBuf;
|
||||
use std::sync::Arc;
|
||||
use std::io;
|
||||
use std::time::Duration;
|
||||
|
||||
use errors::*;
|
||||
|
||||
@@ -42,12 +41,13 @@ pub(crate) fn connection() -> Pool {
|
||||
}
|
||||
|
||||
fn init_pool(db_path: &str) -> Pool {
|
||||
let config = r2d2::Config::builder()
|
||||
.pool_size(1)
|
||||
.connection_timeout(Duration::from_secs(60))
|
||||
.build();
|
||||
let manager = ConnectionManager::<SqliteConnection>::new(db_path);
|
||||
let pool = Arc::new(r2d2::Pool::new(config, manager).expect("Failed to create pool."));
|
||||
let config = r2d2::Pool::builder()
|
||||
.max_size(1)
|
||||
.build(manager)
|
||||
.expect("Failed to create pool.");
|
||||
|
||||
let pool = Arc::new(config);
|
||||
|
||||
{
|
||||
let db = Arc::clone(&pool).get().expect("Failed to initialize pool.");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use diesel::result;
|
||||
use diesel::migrations::RunMigrationsError;
|
||||
use diesel_migrations::RunMigrationsError;
|
||||
use rss;
|
||||
use reqwest;
|
||||
use r2d2;
|
||||
@@ -8,7 +8,7 @@ use std::io;
|
||||
|
||||
error_chain! {
|
||||
foreign_links {
|
||||
R2D2TimeoutError(r2d2::GetTimeout);
|
||||
R2D2Error(r2d2::Error);
|
||||
DieselResultError(result::Error);
|
||||
DieselMigrationError(RunMigrationsError);
|
||||
RSSError(rss::Error);
|
||||
|
||||
@@ -4,7 +4,7 @@ use rayon::prelude::*;
|
||||
use diesel::prelude::*;
|
||||
use rayon::iter::IntoParallelIterator;
|
||||
|
||||
use diesel::Identifiable;
|
||||
use diesel::associations::Identifiable;
|
||||
use rss;
|
||||
|
||||
use dbqueries;
|
||||
|
||||
@@ -30,8 +30,9 @@ extern crate log;
|
||||
|
||||
#[macro_use]
|
||||
extern crate diesel;
|
||||
|
||||
#[macro_use]
|
||||
extern crate diesel_codegen;
|
||||
extern crate diesel_migrations;
|
||||
|
||||
extern crate chrono;
|
||||
extern crate r2d2;
|
||||
|
||||
Reference in New Issue
Block a user