Pipeline: Split the pipeline from the cpu-pool and the tokio-core.

This commit is contained in:
Jordan Petridis
2018-01-26 13:34:04 +02:00
parent b370af35d4
commit 2912bad110
5 changed files with 93 additions and 45 deletions
+2 -2
View File
@@ -119,7 +119,7 @@ mod tests {
use hammond_data::{Episode, Source};
use hammond_data::dbqueries;
use hammond_data::pipeline::pipeline;
use hammond_data::pipeline;
use hammond_data::utils::get_download_folder;
use std::{thread, time};
@@ -138,7 +138,7 @@ mod tests {
let source = Source::from_url(url).unwrap();
// Copy it's id
let sid = source.id();
pipeline(vec![source], true).unwrap();
pipeline::run(vec![source], true).unwrap();
// Get the Podcast
let pd = dbqueries::get_podcast_from_source_id(sid).unwrap();
+3 -4
View File
@@ -28,13 +28,13 @@ pub fn refresh_feed(headerbar: Arc<Header>, source: Option<Vec<Source>>, sender:
if let Some(s) = source {
// feed::index_loop(s);
// TODO: determine if it needs to ignore_etags.
if let Err(err) = pipeline::pipeline(s, true) {
if let Err(err) = pipeline::run(s, true) {
error!("Error While trying to update the database.");
error!("Error msg: {}", err);
}
} else {
let sources = dbqueries::get_sources().unwrap();
if let Err(err) = pipeline::pipeline(sources, false) {
if let Err(err) = pipeline::run(sources, false) {
error!("Error While trying to update the database.");
error!("Error msg: {}", err);
}
@@ -83,7 +83,6 @@ mod tests {
use super::*;
use hammond_data::Source;
use hammond_data::dbqueries;
use hammond_data::pipeline::pipeline;
#[test]
// This test inserts an rss feed to your `XDG_DATA/hammond/hammond.db` so we make it explicit
@@ -95,7 +94,7 @@ mod tests {
let source = Source::from_url(url).unwrap();
// Copy it's id
let sid = source.id();
pipeline(vec![source], true).unwrap();
pipeline::run(vec![source], true).unwrap();
// Get the Podcast
let pd = dbqueries::get_podcast_from_source_id(sid).unwrap();