Cleaned some minor TODO's.
This commit is contained in:
parent
78454f6474
commit
423e0a6e7b
@ -149,7 +149,7 @@ fn index_channel_items(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// TODO: maybe refactor into an Iterator for lazy evaluation.
|
||||
// Maybe this can be refactored into an Iterator for lazy evaluation.
|
||||
pub fn fetch_feeds(
|
||||
connection: Arc<Mutex<SqliteConnection>>,
|
||||
force: bool,
|
||||
|
||||
@ -66,24 +66,22 @@ lazy_static!{
|
||||
};
|
||||
}
|
||||
|
||||
// TODO: REFACTOR
|
||||
pub fn init() -> Result<()> {
|
||||
let conn = establish_connection();
|
||||
// embedded_migrations::run(&conn)?;
|
||||
embedded_migrations::run_with_output(&conn, &mut std::io::stdout())?;
|
||||
run_migration_on(&conn)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn run_migration_on(connection: &SqliteConnection) -> Result<()> {
|
||||
info!("Running DB Migrations...");
|
||||
// embedded_migrations::run(&conn)?;
|
||||
embedded_migrations::run_with_output(connection, &mut std::io::stdout())?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn establish_connection() -> SqliteConnection {
|
||||
let database_url = DB_PATH.to_str().unwrap();
|
||||
// let database_url = &String::from(".random/foo.db");
|
||||
SqliteConnection::establish(database_url)
|
||||
.expect(&format!("Error connecting to {}", database_url))
|
||||
}
|
||||
|
||||
@ -198,7 +198,6 @@ impl<'a> Source {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Remove pub fields and add setters.
|
||||
#[derive(Insertable)]
|
||||
#[table_name = "source"]
|
||||
#[derive(Debug, Clone)]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user