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:
Jordan Petridis
2017-12-02 01:39:28 +02:00
parent 9312366f62
commit 74a1aae168
13 changed files with 193 additions and 167 deletions
+6 -6
View File
@@ -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.");
+2 -2
View File
@@ -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);
+1 -1
View File
@@ -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;
+2 -1
View File
@@ -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;