More sync cleanup and fixing

This commit is contained in:
Dominic Ferrando
2026-06-29 12:14:06 -04:00
parent ae623b9c09
commit 255c6717b7
3 changed files with 73 additions and 44 deletions
+2 -2
View File
@@ -147,7 +147,7 @@ export const app = new Elysia()
})
// Per-product sync
.post("/:printfulProductId", async ({ params }) => {
if (!await productSyncer.sync(params.printfulProductId))
if (!await productSyncer.sync({ printfulProductIdsFilter: [params.printfulProductId] }))
throw status(409, "Sync already in progress");
}, { params: z.object({ printfulProductId: z.coerce.number() }) }),
)
@@ -175,7 +175,7 @@ export const app = new Elysia()
case Printful.Webhook.Event.ProductUpdated: {
const printfulProduct = payload.data.sync_product;
log.info({ productId: printfulProduct.id }, "printful webhook: product updated");
await productSyncer.sync(printfulProduct.id);
await productSyncer.sync({ printfulProductIdsFilter: [printfulProduct.id] });
break;
}
case Printful.Webhook.Event.ProductDeleted: {