Skip to content

Commit

Permalink
fix: move db path, fix compile error (TabbyML#820)
Browse files Browse the repository at this point in the history
  • Loading branch information
darknight authored Nov 18, 2023
1 parent 33e817e commit fcfa131
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/tabby/src/services/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub async fn load_text_generation(
parallelism: u8,
) -> (Arc<dyn TextGeneration>, PromptInfo) {
#[cfg(feature = "experimental-http")]
if args.device == crate::serve::Device::ExperimentalHttp {
if device == &Device::ExperimentalHttp {
let (engine, prompt_template) = http_api_bindings::create(model_id);
return (
engine,
Expand Down
9 changes: 6 additions & 3 deletions ee/tabby-webserver/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ lazy_static! {
),]);
}

fn db_file() -> PathBuf {
tabby_root().join("db.sqlite3")
async fn db_path() -> Result<PathBuf> {
let db_dir = tabby_root().join("ee");
tokio::fs::create_dir_all(db_dir.clone()).await?;
Ok(db_dir.join("db.sqlite"))
}

pub struct DbConn {
Expand All @@ -31,7 +33,8 @@ pub struct DbConn {

impl DbConn {
pub async fn new() -> Result<Self> {
let conn = Connection::open(db_file()).await?;
let db_path = db_path().await?;
let conn = Connection::open(db_path).await?;
Self::init_db(conn).await
}

Expand Down

0 comments on commit fcfa131

Please sign in to comment.