1
0
Fork 0
forked from alemi/upub

fix: add special case for 447 from lemmy.cafe

because its clogging my job queue
This commit is contained in:
əlemi 2024-07-05 02:43:01 +02:00
parent d6b9ab4cfd
commit 7079662391
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -146,6 +146,15 @@ impl JobDispatcher for Context {
Err(JobError::ProcessorError(ProcessorError::PullError(PullError::Malformed(f)))) => Err(JobError::ProcessorError(ProcessorError::PullError(PullError::Malformed(f)))) =>
tracing::warn!("dropping job because requested resource could not be verified (fetch is invalid AP object: {f})"), tracing::warn!("dropping job because requested resource could not be verified (fetch is invalid AP object: {f})"),
Err(e) => { Err(e) => {
if let JobError::ProcessorError(ProcessorError::PullError(PullError::Fetch(status, ref e))) = e {
// TODO maybe convert this in generic .is_client_error() check, but excluding 401s
// and 400s because we want to retry those. also maybe 406s? idk theres a lot i
// just want to drop lemmy.cafe jobs
if status.as_u16() == 447 {
tracing::warn!("dropping job with non-standard error {status} because requested resource is not available: {e}");
return;
}
}
tracing::error!("failed processing job '{}': {e}", job.activity); tracing::error!("failed processing job '{}': {e}", job.activity);
let active = job.clone().repeat(); let active = job.clone().repeat();
let mut count = 0; let mut count = 0;
@ -162,7 +171,6 @@ impl JobDispatcher for Context {
tokio::time::sleep(std::time::Duration::from_secs(poll_interval)).await; tokio::time::sleep(std::time::Duration::from_secs(poll_interval)).await;
} }
} }
} }
}); });