diff --git a/Cargo.toml b/Cargo.toml index 5ae805e..57d04b3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "apalis-postgres" -version = "1.0.0-alpha.2" +version = "1.0.0-alpha.3" authors = ["Njuguna Mureithi "] edition = "2024" repository = "https://github.com/apalis-dev/apalis-postgres" @@ -22,11 +22,11 @@ tokio-comp = ["tokio", "sqlx/runtime-tokio-rustls"] tokio-comp-native-tls = ["tokio", "sqlx/runtime-tokio-native-tls"] [dependencies] -apalis-core = { version = "1.0.0-alpha.7", default-features = false, features = [ +apalis-core = { version = "1.0.0-alpha.8", default-features = false, features = [ "sleep", "json", ] } -apalis-sql = { version = "1.0.0-alpha.7", default-features = false } +apalis-sql = { version = "1.0.0-alpha.8", default-features = false } serde = { version = "1", features = ["derive"] } chrono = { version = "0.4", features = ["serde"] } pin-project = "1.1.10" @@ -46,5 +46,5 @@ features = ["chrono", "postgres", "json"] [dev-dependencies] tokio = { version = "1", features = ["macros", "rt-multi-thread"] } once_cell = "1.19.0" -apalis-core = { version = "1.0.0-alpha.7", features = ["test-utils"] } -apalis-workflow = { version = "0.1.0-alpha.5" } +apalis-core = { version = "1.0.0-alpha.8", features = ["test-utils"] } +apalis-workflow = { version = "0.1.0-alpha.6" } diff --git a/src/ack.rs b/src/ack.rs index 5c1fa10..817c7ee 100644 --- a/src/ack.rs +++ b/src/ack.rs @@ -11,7 +11,7 @@ use ulid::Ulid; use crate::{PgTask, context::PgContext}; -#[derive(Clone)] +#[derive(Debug, Clone)] pub struct PgAck { pool: PgPool, } @@ -81,6 +81,8 @@ pub async fn lock_task(pool: &PgPool, task_id: &Ulid, worker_id: &str) -> Result Ok(()) } +#[derive(Debug, Clone)] + pub struct LockTaskLayer { pool: PgPool, } @@ -102,6 +104,7 @@ impl Layer for LockTaskLayer { } } +#[derive(Debug, Clone)] pub struct LockTaskService { inner: S, pool: PgPool, diff --git a/src/queries/list_workers.rs b/src/queries/list_workers.rs index 1d7ebfd..0c4c757 100644 --- a/src/queries/list_workers.rs +++ b/src/queries/list_workers.rs @@ -1,5 +1,5 @@ use apalis_core::backend::{Backend, ListWorkers, RunningWorker}; -use apalis_sql::{ context::SqlContext}; +use apalis_sql::context::SqlContext; use chrono::{DateTime, Utc}; use futures::TryFutureExt; use ulid::Ulid; @@ -14,7 +14,6 @@ pub struct WorkerRow { pub started_at: Option>, } - use crate::{CompactType, PostgresStorage}; impl ListWorkers for PostgresStorage diff --git a/src/queries/reenqueue_orphaned.rs b/src/queries/reenqueue_orphaned.rs index e2cd953..2c3b012 100644 --- a/src/queries/reenqueue_orphaned.rs +++ b/src/queries/reenqueue_orphaned.rs @@ -1,7 +1,7 @@ use std::time::Duration; use futures::{FutureExt, Stream, stream}; -use sqlx::{postgres::types::PgInterval, PgPool}; +use sqlx::{PgPool, postgres::types::PgInterval}; use crate::Config;