Files
klz-cables.com/.pnpm-store/v10/files/cc/016158a3a434c8bab1f83893ba4780651b2e8ffd23a12e1d8d308b6226f927f37fd91a33b9350a184e5404bf482b89824fe7220fb1ddef6d253e932a8ff9f1
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

47 lines
1.5 KiB
Plaintext

import { jobsCollectionSlug } from '../queues/config/collection.js';
export const deleteScheduledPublishJobs = async ({ id, slug, payload, req })=>{
try {
await payload.db.deleteMany({
collection: jobsCollectionSlug,
req,
where: {
and: [
// only want to delete jobs have not run yet
{
completedAt: {
exists: false
}
},
{
processing: {
equals: false
}
},
{
'input.doc.value': {
equals: id
}
},
{
'input.doc.relationTo': {
equals: slug
}
},
// data.type narrows scheduled publish jobs in case of another job having input.doc.value
{
taskSlug: {
equals: 'schedulePublish'
}
}
]
}
});
} catch (err) {
payload.logger.error({
err,
msg: `There was an error deleting scheduled publish jobs from the queue for ${slug} document with ID ${id}.`
});
}
};
//# sourceMappingURL=deleteScheduledPublishJobs.js.map