fix: save file_states after prompt etag update to stop PROMPT.md download loop
All checks were successful
BotServer CI/CD / build (push) Successful in 3m41s
All checks were successful
BotServer CI/CD / build (push) Successful in 3m41s
This commit is contained in:
parent
f4c99030aa
commit
5fdb3be5b4
1 changed files with 9 additions and 0 deletions
|
|
@ -642,6 +642,15 @@ impl DriveMonitor {
|
||||||
}
|
}
|
||||||
let mut states = self.file_states.write().await;
|
let mut states = self.file_states.write().await;
|
||||||
states.insert(prompt_state_key, FileState { etag, indexed: false });
|
states.insert(prompt_state_key, FileState { etag, indexed: false });
|
||||||
|
drop(states);
|
||||||
|
let file_states_clone = Arc::clone(&self.file_states);
|
||||||
|
let work_root_clone = self.work_root.clone();
|
||||||
|
let bot_id_clone = self.bot_id;
|
||||||
|
tokio::spawn(async move {
|
||||||
|
if let Err(e) = Self::save_file_states_static(&file_states_clone, &work_root_clone, &bot_id_clone).await {
|
||||||
|
warn!("Failed to save file states after prompt update: {}", e);
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
trace!("Prompt file {} unchanged (etag match), skipping download", path);
|
trace!("Prompt file {} unchanged (etag match), skipping download", path);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue