Refactor event queue to allow multiple types of events

This commit is contained in:
Dominic Ferrando
2026-07-12 05:21:33 -04:00
parent 4d1b3bc3ef
commit 4c2acfaede
5 changed files with 88 additions and 60 deletions
+3 -3
View File
@@ -37,14 +37,14 @@ export class ProductSyncer {
this.log = (log ?? pino({ level: "silent" })).child({ component: "ProductSyncer" });
}
async run(opt: ProductSyncerOptions = {}) {
async syncApparel(opt: ProductSyncerOptions = {}) {
const startDate = new Date();
await opt.beforeStart?.(startDate);
if (opt.filter?.pProductIds)
this.log.info({ pProductIds: opt.filter.pProductIds }, "sync started (filtered)");
this.log.info({ pProductIds: opt.filter.pProductIds }, "apparel sync started (filtered)");
else
this.log.info("sync started (all)");
this.log.info("apparel sync started (all)");
this.log.debug("retrieving webflow products");
const allWProducts = await this.Webflow.Products.list({ forceAll: true });