fix: check_gbot only scans .gbot/ folder, not entire bucket
All checks were successful
BotServer CI/CD / build (push) Successful in 4m21s
All checks were successful
BotServer CI/CD / build (push) Successful in 4m21s
- Added prefix filter to list_objects_v2 call: only scans {bot}.gbot/
- Removed scanning of .gbkb and .gbdialog paths which caused 5min timeouts
- This fixes salesianos DriveMonitor timeout and embed/index failure
Also fixed header detection for name,value CSV format.
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
parent
4dbc418aab
commit
ad998b52d4
1 changed files with 8 additions and 8 deletions
|
|
@ -665,9 +665,11 @@ impl DriveMonitor {
|
|||
async fn check_gbot(&self, client: &Client) -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||
trace!("check_gbot ENTER");
|
||||
let config_manager = ConfigManager::new(self.state.conn.clone());
|
||||
let bot_name = self.bucket_name.strip_suffix(".gbai").unwrap_or(&self.bucket_name);
|
||||
let gbot_prefix = format!("{}.gbot/", bot_name);
|
||||
debug!(
|
||||
"check_gbot: Checking bucket {} for config.csv changes",
|
||||
self.bucket_name
|
||||
"check_gbot: Checking bucket {} for config.csv changes (prefix: {})",
|
||||
self.bucket_name, gbot_prefix
|
||||
);
|
||||
let mut continuation_token = None;
|
||||
loop {
|
||||
|
|
@ -676,6 +678,7 @@ impl DriveMonitor {
|
|||
client
|
||||
.list_objects_v2()
|
||||
.bucket(self.bucket_name.to_lowercase())
|
||||
.prefix(&gbot_prefix)
|
||||
.set_continuation_token(continuation_token)
|
||||
.send(),
|
||||
)
|
||||
|
|
@ -698,14 +701,11 @@ impl DriveMonitor {
|
|||
let path = obj.key().unwrap_or_default().to_string();
|
||||
let path_lower = path.to_ascii_lowercase();
|
||||
|
||||
let is_config_csv = path_lower == "config.csv"
|
||||
|| path_lower.ends_with("/config.csv")
|
||||
|| path_lower.contains(".gbot/config.csv");
|
||||
let is_config_csv = path_lower.ends_with("/config.csv")
|
||||
|| path_lower == "config.csv";
|
||||
|
||||
let is_prompt_file = path_lower.ends_with("prompt.md")
|
||||
|| path_lower.ends_with("prompt.txt")
|
||||
|| path_lower.ends_with("PROMPT.MD")
|
||||
|| path_lower.ends_with("PROMPT.TXT");
|
||||
|| path_lower.ends_with("prompt.txt");
|
||||
|
||||
debug!("check_gbot: Checking path: {} (is_config_csv: {}, is_prompt: {})", path, is_config_csv, is_prompt_file);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue