Skip to content

Commit

Permalink
fix: tests and api
Browse files Browse the repository at this point in the history
  • Loading branch information
geofmureithi committed Jul 4, 2024
1 parent 6c145a3 commit e8c900d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
6 changes: 5 additions & 1 deletion packages/apalis-redis/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,11 @@ mod tests {
let job_id = &job.get::<Context>().unwrap().id;

storage
.ack(&worker_id, &job_id)
.ack(AckResponse {
acknowledger: job_id.clone(),
result: "Success".to_string(),
worker: worker_id.clone(),
})
.await
.expect("failed to acknowledge the job");

Expand Down
6 changes: 5 additions & 1 deletion packages/apalis-sql/src/mysql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,11 @@ mod tests {
let job_id = ctx.id();

storage
.ack(&worker_id, job_id)
.ack(AckResponse {
acknowledger: job_id.clone(),
result: "Success".to_string(),
worker: worker_id.clone(),
})
.await
.expect("failed to acknowledge the job");

Expand Down
9 changes: 6 additions & 3 deletions packages/apalis-sql/src/postgres.rs
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,6 @@ mod tests {

use super::*;
use email_service::Email;
use futures::StreamExt;
use sqlx::types::chrono::Utc;

/// migrate DB and return a storage instance.
Expand Down Expand Up @@ -638,7 +637,7 @@ mod tests {
storage: &mut PostgresStorage<Email>,
worker_id: &WorkerId,
) -> Request<Email> {
let mut req = storage.fetch_next(worker_id).await;
let req = storage.fetch_next(worker_id).await;
req.unwrap()[0].clone()
}

Expand Down Expand Up @@ -699,7 +698,11 @@ mod tests {
let job_id = ctx.id();

storage
.ack(&worker_id, job_id)
.ack(AckResponse {
acknowledger: job_id.clone(),
result: "Success".to_string(),
worker: worker_id.clone(),
})
.await
.expect("failed to acknowledge the job");

Expand Down
6 changes: 5 additions & 1 deletion packages/apalis-sql/src/sqlite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,11 @@ mod tests {
let job_id = ctx.id();

storage
.ack(&worker_id, job_id)
.ack(AckResponse {
acknowledger: job_id.clone(),
result: "Success".to_string(),
worker: worker_id.clone(),
})
.await
.expect("failed to acknowledge the job");

Expand Down

0 comments on commit e8c900d

Please sign in to comment.