mirror of
https://github.com/Diggsey/sqlxmq.git
synced 2024-11-25 01:31:03 +00:00
Fix clippy lints in unit tests
This commit is contained in:
parent
9424605cfb
commit
4c52fe9f24
1 changed files with 7 additions and 7 deletions
14
src/lib.rs
14
src/lib.rs
|
@ -296,7 +296,7 @@ mod tests {
|
||||||
|
|
||||||
let _ = dotenv::dotenv();
|
let _ = dotenv::dotenv();
|
||||||
|
|
||||||
INIT_LOGGER.call_once(|| pretty_env_logger::init());
|
INIT_LOGGER.call_once(pretty_env_logger::init);
|
||||||
|
|
||||||
let pool = Pool::connect(&env::var("DATABASE_URL").unwrap())
|
let pool = Pool::connect(&env::var("DATABASE_URL").unwrap())
|
||||||
.await
|
.await
|
||||||
|
@ -384,7 +384,7 @@ mod tests {
|
||||||
{
|
{
|
||||||
let pool = &*test_pool().await;
|
let pool = &*test_pool().await;
|
||||||
let (_runner, counter) =
|
let (_runner, counter) =
|
||||||
test_job_runner(&pool, |mut job| async move { job.complete().await }).await;
|
test_job_runner(pool, |mut job| async move { job.complete().await }).await;
|
||||||
|
|
||||||
assert_eq!(counter.load(Ordering::SeqCst), 0);
|
assert_eq!(counter.load(Ordering::SeqCst), 0);
|
||||||
JobBuilder::new("foo").spawn(pool).await.unwrap();
|
JobBuilder::new("foo").spawn(pool).await.unwrap();
|
||||||
|
@ -432,7 +432,7 @@ mod tests {
|
||||||
sqlxmq::clear(pool, &["foo", "baz"]).await.unwrap();
|
sqlxmq::clear(pool, &["foo", "baz"]).await.unwrap();
|
||||||
|
|
||||||
let (_runner, counter) =
|
let (_runner, counter) =
|
||||||
test_job_runner(&pool, |mut job| async move { job.complete().await }).await;
|
test_job_runner(pool, |mut job| async move { job.complete().await }).await;
|
||||||
|
|
||||||
pause().await;
|
pause().await;
|
||||||
assert_eq!(counter.load(Ordering::SeqCst), 2);
|
assert_eq!(counter.load(Ordering::SeqCst), 2);
|
||||||
|
@ -446,7 +446,7 @@ mod tests {
|
||||||
let pool = &*test_pool().await;
|
let pool = &*test_pool().await;
|
||||||
let (tx, mut rx) = mpsc::unbounded();
|
let (tx, mut rx) = mpsc::unbounded();
|
||||||
|
|
||||||
let (_runner, counter) = test_job_runner(&pool, move |job| {
|
let (_runner, counter) = test_job_runner(pool, move |job| {
|
||||||
let tx = tx.clone();
|
let tx = tx.clone();
|
||||||
async move {
|
async move {
|
||||||
tx.unbounded_send(job).unwrap();
|
tx.unbounded_send(job).unwrap();
|
||||||
|
@ -484,7 +484,7 @@ mod tests {
|
||||||
let pool = &*test_pool().await;
|
let pool = &*test_pool().await;
|
||||||
let (tx, mut rx) = mpsc::unbounded();
|
let (tx, mut rx) = mpsc::unbounded();
|
||||||
|
|
||||||
let (_runner, counter) = test_job_runner(&pool, move |job| {
|
let (_runner, counter) = test_job_runner(pool, move |job| {
|
||||||
let tx = tx.clone();
|
let tx = tx.clone();
|
||||||
async move {
|
async move {
|
||||||
tx.unbounded_send(job).unwrap();
|
tx.unbounded_send(job).unwrap();
|
||||||
|
@ -511,7 +511,7 @@ mod tests {
|
||||||
async fn it_retries_failed_jobs() {
|
async fn it_retries_failed_jobs() {
|
||||||
{
|
{
|
||||||
let pool = &*test_pool().await;
|
let pool = &*test_pool().await;
|
||||||
let (_runner, counter) = test_job_runner(&pool, move |_| async {}).await;
|
let (_runner, counter) = test_job_runner(pool, move |_| async {}).await;
|
||||||
|
|
||||||
let backoff = 500;
|
let backoff = 500;
|
||||||
|
|
||||||
|
@ -548,7 +548,7 @@ mod tests {
|
||||||
async fn it_can_checkpoint_jobs() {
|
async fn it_can_checkpoint_jobs() {
|
||||||
{
|
{
|
||||||
let pool = &*test_pool().await;
|
let pool = &*test_pool().await;
|
||||||
let (_runner, counter) = test_job_runner(&pool, move |mut current_job| async move {
|
let (_runner, counter) = test_job_runner(pool, move |mut current_job| async move {
|
||||||
let state: bool = current_job.json().unwrap().unwrap();
|
let state: bool = current_job.json().unwrap().unwrap();
|
||||||
if state {
|
if state {
|
||||||
current_job.complete().await.unwrap();
|
current_job.complete().await.unwrap();
|
||||||
|
|
Loading…
Reference in a new issue