Improve naming of product sync hooks

This commit is contained in:
Dominic Ferrando
2026-07-11 15:47:31 -04:00
parent da3c9e588e
commit d40b9209d5
2 changed files with 10 additions and 10 deletions
+4 -4
View File
@@ -47,19 +47,19 @@ class ProductSyncService {
log.info({ session: payload.session }, "starting sync run");
await this.ProductSyncer.run({
filter: payload.filter,
onStart: async (startDate) => {
beforeStart: async (startDate) => {
await this.Queue.enqueue(payload, startDate);
},
onStep: async (pProductIds: number[]) => {
beforeStep: async (pProductIds: number[]) => {
if (!id) throw new Error("Expected sync run ID");
await db.updateTable("product_syncs")
.set({ syncing_p_product_ids: pProductIds })
.where("id", "=", id)
.execute();
},
onCompletion: async (completionDate, duration) => {
afterCompletion: async (endDate, duration) => {
if (!id) throw new Error("Expected sync run ID");
await this.Queue.fulfill(id, completionDate)
await this.Queue.fulfill(id, endDate)
freedSlot = true;
}
});