Skip to content

Commit

Permalink
fix: remove unnecessary type annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgehermo9 committed Oct 22, 2024
1 parent 008f66f commit 3af00a9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions crates/server/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use apalis::{
cron::{CronStream, Schedule},
cron::CronStream,
layers::retry::{RetryLayer, RetryPolicy},
prelude::{Monitor, WorkerBuilder, WorkerFactoryFn},
utils::TokioExecutor,
Expand Down Expand Up @@ -101,15 +101,14 @@ async fn start_background_tasks(
cron_expression: String,
db_connection: PgPool,
) -> Result<(), StartError> {
let schedule: Schedule = cron_expression
let schedule = cron_expression
.parse()
.map_err(|e| SchedulerError::CronExpressionError(cron_expression.to_string(), e))?;

tracing::info!(schedule = %schedule, "Starting cleanup task worker");

let worker = WorkerBuilder::new("cleanup-task-worker")
.layer(RetryLayer::new(RetryPolicy::retries(5)))
// .layer(TraceLayer::new().make_span_with(ReminderSpan::new()))
.stream(CronStream::new(schedule).into_stream())
.data(db_connection)
.build_fn(cleanup::execute_cleanup);
Expand Down

0 comments on commit 3af00a9

Please sign in to comment.