Split stuff into a utils.rs module.

This commit is contained in:
Jordan Petridis 2017-10-18 18:49:35 +03:00
parent 52f2fa8791
commit b6d2be3ff5
No known key found for this signature in database
GPG Key ID: CEABAD9F5683B9A6

13
hammond-gtk/src/utils.rs Normal file
View 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();
});
}