chore: split prod / dev for job db (#2216)

* 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>
This commit is contained in:
Meng Zhang 2024-05-21 17:33:42 -07:00 committed by GitHub
parent 5027d466ed
commit a1cae7b38c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 8 deletions

View File

@ -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" }

View File

@ -6,7 +6,7 @@ authors.workspace = true
homepage.workspace = true
[features]
prod-db = []
prod = []
[dependencies]
anyhow.workspace = true

View File

@ -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")
}
}