Upgrade apalis, add fred pool to state, start publishing in jobs

This commit is contained in:
2024-09-22 13:44:55 -04:00
parent 6912ef9017
commit 3d5c0b78c3
8 changed files with 69 additions and 23 deletions

View File

@@ -27,13 +27,11 @@ pub enum AsyncJobError {
JobError(#[from] anyhow::Error),
}
#[instrument(skip_all, fields(worker_id = %worker_id))]
#[instrument(skip_all, fields(worker_id = ?worker_id, task_id = ?task_id))]
pub async fn handle_async_job(
job: AsyncJob,
worker_id: WorkerId,
// TODO: add task_id to tracing instrumentation context
// it casuses a panic in 0.6.0 currently, see: https://github.com/geofmureithi/apalis/issues/398
// task_id: Data<TaskId>,
worker_id: Data<WorkerId>,
task_id: Data<TaskId>,
http_client: Data<Client>,
db: Data<PgPool>,
domain_request_limiter: Data<DomainRequestLimiter>,