make the job permanent fail if missing required details

pull/799/head
ryanzhao 2 years ago
parent 3a7517ec64
commit e278c205ba

@ -25,7 +25,7 @@ public enum AttachmentDownloadJob: JobExecutor {
let attachment: Attachment = Storage.shared let attachment: Attachment = Storage.shared
.read({ db in try Attachment.fetchOne(db, id: details.attachmentId) }) .read({ db in try Attachment.fetchOne(db, id: details.attachmentId) })
else { else {
failure(job, JobRunnerError.missingRequiredDetails, false) failure(job, JobRunnerError.missingRequiredDetails, true)
return return
} }

@ -31,7 +31,7 @@ public enum AttachmentUploadJob: JobExecutor {
return (attachment, try OpenGroup.fetchOne(db, id: threadId)) return (attachment, try OpenGroup.fetchOne(db, id: threadId))
}) })
else { else {
failure(job, JobRunnerError.missingRequiredDetails, false) failure(job, JobRunnerError.missingRequiredDetails, true)
return return
} }

@ -24,7 +24,7 @@ public enum GroupLeavingJob: JobExecutor {
let details: Details = try? JSONDecoder().decode(Details.self, from: detailsData), let details: Details = try? JSONDecoder().decode(Details.self, from: detailsData),
let interactionId: Int64 = job.interactionId let interactionId: Int64 = job.interactionId
else { else {
failure(job, JobRunnerError.missingRequiredDetails, false) failure(job, JobRunnerError.missingRequiredDetails, true)
return return
} }

@ -21,7 +21,7 @@ public enum MessageReceiveJob: JobExecutor {
let detailsData: Data = job.details, let detailsData: Data = job.details,
let details: Details = try? JSONDecoder().decode(Details.self, from: detailsData) let details: Details = try? JSONDecoder().decode(Details.self, from: detailsData)
else { else {
failure(job, JobRunnerError.missingRequiredDetails, false) failure(job, JobRunnerError.missingRequiredDetails, true)
return return
} }

@ -23,7 +23,7 @@ public enum MessageSendJob: JobExecutor {
let detailsData: Data = job.details, let detailsData: Data = job.details,
let details: Details = try? JSONDecoder().decode(Details.self, from: detailsData) let details: Details = try? JSONDecoder().decode(Details.self, from: detailsData)
else { else {
failure(job, JobRunnerError.missingRequiredDetails, false) failure(job, JobRunnerError.missingRequiredDetails, true)
return return
} }
@ -36,7 +36,7 @@ public enum MessageSendJob: JobExecutor {
let jobId: Int64 = job.id, let jobId: Int64 = job.id,
let interactionId: Int64 = job.interactionId let interactionId: Int64 = job.interactionId
else { else {
failure(job, JobRunnerError.missingRequiredDetails, false) failure(job, JobRunnerError.missingRequiredDetails, true)
return return
} }

@ -21,7 +21,7 @@ public enum NotifyPushServerJob: JobExecutor {
let detailsData: Data = job.details, let detailsData: Data = job.details,
let details: Details = try? JSONDecoder().decode(Details.self, from: detailsData) let details: Details = try? JSONDecoder().decode(Details.self, from: detailsData)
else { else {
failure(job, JobRunnerError.missingRequiredDetails, false) failure(job, JobRunnerError.missingRequiredDetails, true)
return return
} }

@ -23,7 +23,7 @@ public enum SendReadReceiptsJob: JobExecutor {
let detailsData: Data = job.details, let detailsData: Data = job.details,
let details: Details = try? JSONDecoder().decode(Details.self, from: detailsData) let details: Details = try? JSONDecoder().decode(Details.self, from: detailsData)
else { else {
failure(job, JobRunnerError.missingRequiredDetails, false) failure(job, JobRunnerError.missingRequiredDetails, true)
return return
} }

Loading…
Cancel
Save