Skip to content

Commit

Permalink
chore: split prod / dev for job db (#2216)
Browse files Browse the repository at this point in the history
* chore: split prod / dev for job db

* update

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
wsxiaoys and autofix-ci[bot] authored May 22, 2024
1 parent 5027d46 commit a1cae7b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion crates/tabby/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ vulkan = ["llama-cpp-server/vulkan"]
# architecture, enable this feature to compile OpenSSL as part of the build.
# See https://docs.rs/openssl/#vendored for more.
static-ssl = ['openssl/vendored']
prod = ["ee", 'tabby-webserver/prod-db']
prod = ["ee", 'tabby-webserver/prod']

[dependencies]
tabby-common = { path = "../tabby-common" }
Expand Down
2 changes: 1 addition & 1 deletion ee/tabby-webserver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors.workspace = true
homepage.workspace = true

[features]
prod-db = []
prod = []

[dependencies]
anyhow.workspace = true
Expand Down
13 changes: 7 additions & 6 deletions ee/tabby-webserver/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ pub fn tabby_ee_root() -> PathBuf {
}

pub fn db_file() -> PathBuf {
#[cfg(feature = "prod-db")]
{
if cfg!(feature = "prod") {
tabby_ee_root().join("db.sqlite")
}
#[cfg(not(feature = "prod-db"))]
{
} else {
tabby_ee_root().join("dev-db.sqlite")
}
}

pub fn job_db_file() -> PathBuf {
tabby_ee_root().join("job.sqlite")
if cfg!(feature = "prod") {
tabby_ee_root().join("job.sqlite")
} else {
tabby_ee_root().join("dev-job.sqlite")
}
}

0 comments on commit a1cae7b

Please sign in to comment.