Skip to content

Commit

Permalink
chore(webserver): use in memory job queue (#2027)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsxiaoys authored May 2, 2024
1 parent 2c5c306 commit 28cf9ea
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
4 changes: 0 additions & 4 deletions ee/tabby-webserver/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,3 @@ pub fn db_file() -> PathBuf {
tabby_ee_root().join("dev-db.sqlite")
}
}

pub fn job_queue() -> PathBuf {
tabby_ee_root().join("job_queue.sqlite")
}
4 changes: 1 addition & 3 deletions ee/tabby-webserver/src/service/background_job/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use tabby_db::DbConn;
use self::{
db::DbMaintainanceJob, github::SyncGithubJob, gitlab::SyncGitlabJob, scheduler::SchedulerJob,
};
use crate::path::job_queue;

#[async_trait]
pub trait BackgroundJob: Send + Sync {
Expand All @@ -32,8 +31,7 @@ struct BackgroundJobImpl {
}

pub async fn create(db: DbConn, local_port: u16) -> Arc<dyn BackgroundJob> {
let path = format!("sqlite://{}?mode=rwc", job_queue().display());
let pool = SqlitePool::connect(&path)
let pool = SqlitePool::connect("sqlite::memory:")
.await
.expect("unable to create sqlite pool");
SqliteStorage::setup(&pool)
Expand Down

0 comments on commit 28cf9ea

Please sign in to comment.