Skip to content

Commit c2ab0ab

Browse files
committed
cargo fmt
1 parent 421c13d commit c2ab0ab

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

src/bgworker/mod.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,11 @@ pub trait BackgroundWorker<A: Send + Sync + serde::Serialize + 'static>: Send +
625625
Self::perform_later_with_priority(ctx, args, None).await
626626
}
627627

628-
async fn perform_later_with_priority(ctx: &AppContext, args: A, priority: Option<i32>) -> crate::Result<()>
628+
async fn perform_later_with_priority(
629+
ctx: &AppContext,
630+
args: A,
631+
priority: Option<i32>,
632+
) -> crate::Result<()>
629633
where
630634
Self: Sized,
631635
{
@@ -634,8 +638,14 @@ pub trait BackgroundWorker<A: Send + Sync + serde::Serialize + 'static>: Send +
634638
if let Some(p) = &ctx.queue_provider {
635639
let tags = Self::tags();
636640
let tags_option = if tags.is_empty() { None } else { Some(tags) };
637-
p.enqueue(Self::class_name(), Self::queue(), args, tags_option, priority)
638-
.await?;
641+
p.enqueue(
642+
Self::class_name(),
643+
Self::queue(),
644+
args,
645+
tags_option,
646+
priority,
647+
)
648+
.await?;
639649
} else {
640650
tracing::error!(
641651
"perform_later: background queue is selected, but queue was not populated \

src/bgworker/pg.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,13 @@ async fn connect(cfg: &PostgresQueueConfig) -> Result<PgPool> {
232232
/// This function will return an error if it fails
233233
pub async fn initialize_database(pool: &PgPool) -> Result<()> {
234234
debug!("Initializing job database tables");
235-
235+
236236
// First, check if the table exists
237237
let table_exists: bool = sqlx::query_scalar(
238238
"SELECT EXISTS (
239239
SELECT FROM information_schema.tables
240240
WHERE table_name = 'pg_loco_queue'
241-
)"
241+
)",
242242
)
243243
.fetch_one(pool)
244244
.await?;
@@ -271,7 +271,7 @@ pub async fn initialize_database(pool: &PgPool) -> Result<()> {
271271
SELECT FROM information_schema.columns
272272
WHERE table_name = 'pg_loco_queue'
273273
AND column_name = 'priority'
274-
)"
274+
)",
275275
)
276276
.fetch_one(pool)
277277
.await?;
@@ -283,7 +283,7 @@ pub async fn initialize_database(pool: &PgPool) -> Result<()> {
283283
.await?;
284284
}
285285
}
286-
286+
287287
Ok(())
288288
}
289289

0 commit comments

Comments
 (0)