Split stuff into a utils.rs module.
This commit is contained in:
parent
52f2fa8791
commit
b6d2be3ff5
13
hammond-gtk/src/utils.rs
Normal file
13
hammond-gtk/src/utils.rs
Normal file
@ -0,0 +1,13 @@
|
||||
use hammond_data;
|
||||
use diesel::prelude::*;
|
||||
|
||||
use std::thread;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
pub fn refresh_db(db: Arc<Mutex<SqliteConnection>>) {
|
||||
let db_clone = db.clone();
|
||||
thread::spawn(move || {
|
||||
// FIXME: Handle unwrap
|
||||
hammond_data::index_feed::index_loop(db_clone.clone(), false).unwrap();
|
||||
});
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user