Improve naming of product sync hooks
This commit is contained in:
@@ -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;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user