Change the auto-updater and checkup startup scheduling.
This commit is contained in:
parent
15b3eb115c
commit
2d71a99121
@ -84,8 +84,10 @@ pub fn delete_local_content(ep: &mut EpisodeCleanerQuery) -> Result<()> {
|
|||||||
/// Runs a cleaner for played Episode's that are pass the lifetime limit and
|
/// Runs a cleaner for played Episode's that are pass the lifetime limit and
|
||||||
/// scheduled for removal.
|
/// scheduled for removal.
|
||||||
pub fn checkup() -> Result<()> {
|
pub fn checkup() -> Result<()> {
|
||||||
|
info!("Running database checks.");
|
||||||
download_checker()?;
|
download_checker()?;
|
||||||
played_cleaner()?;
|
played_cleaner()?;
|
||||||
|
info!("Checks completed.");
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -103,9 +103,9 @@ impl App {
|
|||||||
pub fn setup_timed_callbacks(&self) {
|
pub fn setup_timed_callbacks(&self) {
|
||||||
let content = self.content.clone();
|
let content = self.content.clone();
|
||||||
let header = self.header.clone();
|
let header = self.header.clone();
|
||||||
// Update 30 seconds after the Application is initialized.
|
// Update the feeds right after the Application is initialized.
|
||||||
gtk::timeout_add_seconds(
|
gtk::timeout_add_seconds(
|
||||||
30,
|
2,
|
||||||
clone!(content => move || {
|
clone!(content => move || {
|
||||||
utils::refresh_feed(content.clone(), header.clone(), None);
|
utils::refresh_feed(content.clone(), header.clone(), None);
|
||||||
glib::Continue(false)
|
glib::Continue(false)
|
||||||
@ -126,7 +126,7 @@ impl App {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Run a database checkup once the application is initialized.
|
// Run a database checkup once the application is initialized.
|
||||||
gtk::idle_add(move || {
|
gtk::timeout_add(300, || {
|
||||||
let _ = checkup();
|
let _ = checkup();
|
||||||
glib::Continue(false)
|
glib::Continue(false)
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user