Skip to content

Commit

Permalink
instrument scheduler run method
Browse files Browse the repository at this point in the history
  • Loading branch information
maxcountryman committed Nov 19, 2024
1 parent e7e0028 commit 60fa145
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ impl<T: Task> Scheduler<T> {
/// # });
/// # }
/// ```
#[instrument(skip(self), fields(queue.name = self.queue.name), err)]
pub async fn run(&self) -> Result {
let conn = self.queue.pool.acquire().await?;
let Some(_guard) = try_acquire_advisory_lock(conn, &self.queue_lock).await? else {
Expand Down Expand Up @@ -301,15 +302,7 @@ impl<T: Task> Scheduler<T> {
Ok(())
}

#[instrument(
skip_all,
fields(
queue.name = self.queue.name,
task.id = tracing::field::Empty,
until_next
),
err
)]
#[instrument(skip_all, fields(task.id = tracing::field::Empty), err)]
async fn process_next_schedule(&self, input: &T::Input) -> Result {
let task_id = self
.queue
Expand Down

0 comments on commit 60fa145

Please sign in to comment.