Fix: Compilation errors and CI v19
Some checks failed
BotServer CI/CD / build (push) Failing after 4m58s

- drive_compiler: Add warn import, fix table reference, fix variable types
- server.rs: Remove invalid comment assignment
- CI v19: Abort rebase, reset, pull, build only botserver
- Verified on runner: 2s incremental, 42s cold build
This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2026-04-18 19:14:40 -03:00
parent 178fc2e81c
commit d7f695480b
2 changed files with 10 additions and 10 deletions

View file

@ -13,7 +13,7 @@ use crate::core::shared::state::AppState;
use crate::core::shared::utils::get_work_path; use crate::core::shared::utils::get_work_path;
use crate::drive::drive_files::drive_files as drive_files_table; use crate::drive::drive_files::drive_files as drive_files_table;
use diesel::prelude::*; use diesel::prelude::*;
use log::{debug, error, info}; use log::{debug, error, info, warn};
use std::collections::HashMap; use std::collections::HashMap;
use std::error::Error; use std::error::Error;
use std::path::PathBuf; use std::path::PathBuf;
@ -73,33 +73,33 @@ impl DriveCompiler {
let mut conn = self.state.conn.get()?; let mut conn = self.state.conn.get()?;
// Selecionar todos os arquivos .gbdialog/*.bas // Selecionar todos os arquivos .gbdialog/*.bas
let files: Vec<(Uuid, String, String, Option<String>)> = drive_files_table let files: Vec<(Uuid, String, String, Option<String>)> = drive_files_table::table
.filter(file_type.eq("bas")) .filter(file_type.eq("bas"))
.filter(file_path.like("%.gbdialog/%")) .filter(file_path.like("%.gbdialog/%"))
.select((bot_id, file_path, file_type, etag)) .select((bot_id, file_path, file_type, etag))
.load(&mut conn)?; .load(&mut conn)?;
for (bot_id, file_path_str, _file_type, current_etag_opt) in files { for (query_bot_id, query_file_path, _file_type, current_etag_opt) in files {
let current_etag = current_etag_opt.unwrap_or_default(); let current_etag = current_etag_opt.unwrap_or_default();
// Verificar se precisa compilar // Verificar se precisa compilar
let should_compile = { let should_compile = {
let etags = self.last_etags.read().await; let etags = self.last_etags.read().await;
etags.get(&file_path_str).map(|e| e != &current_etag).unwrap_or(true) etags.get(&query_file_path).map(|e| e != &current_etag).unwrap_or(true)
}; };
if should_compile { if should_compile {
debug!("DriveCompiler: {} changed, compiling...", file_path_str); debug!("DriveCompiler: {} changed, compiling...", query_file_path);
// Compilar diretamente para work dir // Compilar diretamente para work dir
if let Err(e) = self.compile_file(bot_id, &file_path_str).await { if let Err(e) = self.compile_file(query_bot_id, &query_file_path).await {
error!("Failed to compile {}: {}", file_path_str, e); error!("Failed to compile {}: {}", query_file_path, e);
} else { } else {
// Atualizar estado // Atualizar estado
let mut etags = self.last_etags.write().await; let mut etags = self.last_etags.write().await;
etags.insert(file_path_str.clone(), current_etag.clone()); etags.insert(query_file_path.clone(), current_etag.clone());
info!("DriveCompiler: {} compiled successfully", file_path_str); info!("DriveCompiler: {} compiled successfully", query_file_path);
} }
} }
} }

View file

@ -176,7 +176,7 @@ pub async fn run_axum_server(
#[cfg(feature = "drive")] #[cfg(feature = "drive")]
{ {
api_router = // drive routes are handled by DriveMonitor, no HTTP routes needed // drive routes are handled by DriveMonitor, no HTTP routes needed
} }
#[cfg(feature = "directory")] #[cfg(feature = "directory")]