aboutsummaryrefslogtreecommitdiff
path: root/src/app/runtime.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/runtime.rs')
-rw-r--r--src/app/runtime.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/app/runtime.rs b/src/app/runtime.rs
index ca780360..cb2e5712 100644
--- a/src/app/runtime.rs
+++ b/src/app/runtime.rs
@@ -257,6 +257,13 @@ impl App {
}
if self
+ .next_agent_manifest_update_check
+ .is_some_and(|deadline| now >= deadline)
+ {
+ self.run_agent_manifest_update_check();
+ }
+
+ if self
.session_save_deadline
.is_some_and(|deadline| now >= deadline)
{
@@ -448,6 +455,18 @@ impl App {
std::thread::spawn(move || crate::update::auto_update(update_tx));
}
+ pub(crate) fn run_agent_manifest_update_check(&mut self) {
+ if !auto_updates_enabled(self.no_session) {
+ self.next_agent_manifest_update_check = None;
+ return;
+ }
+
+ self.next_agent_manifest_update_check = Some(Instant::now() + AUTO_UPDATE_CHECK_INTERVAL);
+
+ let manifest_update_tx = self.event_tx.clone();
+ std::thread::spawn(move || crate::detect::manifest_update::auto_update(manifest_update_tx));
+ }
+
pub(crate) fn start_git_status_refresh_if_due(&mut self, now: Instant) {
let Some(deadline) = self.git_refresh_deadline() else {
return;
@@ -531,6 +550,7 @@ impl App {
.then(|| self.git_refresh_deadline())
.flatten(),
self.next_auto_update_check,
+ self.next_agent_manifest_update_check,
self.agent_metadata_deadline,
self.pending_agent_resume_deadline,
self.session_save_deadline,