Shorten printful/webflow naming convention
This commit is contained in:
@@ -52,7 +52,7 @@ class SyncService {
|
||||
session_id: queuedSync.session.id,
|
||||
session_name: queuedSync.session.name,
|
||||
started_at: startDate,
|
||||
printful_product_id_filter: queuedSync.filter?.printfulProductIds ?? null,
|
||||
p_product_id_filter: queuedSync.filter?.pProductIds ?? null,
|
||||
};
|
||||
if (id) {
|
||||
const result = await db.updateTable("product_syncs")
|
||||
@@ -73,17 +73,17 @@ class SyncService {
|
||||
id = result.id;
|
||||
}
|
||||
},
|
||||
onStep: async (printfulProductIds: number[]) => {
|
||||
onStep: async (pProductIds: number[]) => {
|
||||
if (!id) throw new Error("Expected sync run ID");
|
||||
await db.updateTable("product_syncs")
|
||||
.set({ syncing_printful_product_ids: printfulProductIds })
|
||||
.set({ syncing_p_product_ids: pProductIds })
|
||||
.where("id", "=", id)
|
||||
.execute();
|
||||
},
|
||||
onCompletion: async (completionDate, duration) => {
|
||||
if (!id) throw new Error("Expected sync run ID");
|
||||
await db.updateTable("product_syncs")
|
||||
.set({ syncing_printful_product_ids: [], ended_at: completionDate })
|
||||
.set({ syncing_p_product_ids: [], ended_at: completionDate })
|
||||
.where("id", "=", id)
|
||||
.execute();
|
||||
freedSlot = true;
|
||||
@@ -104,7 +104,7 @@ class SyncService {
|
||||
if (Date.now() - (activeSync.started_at?.getTime() ?? 0) > 600000) {
|
||||
log.info("already active sync exceeded timeout");
|
||||
await db.updateTable("product_syncs")
|
||||
.set({ syncing_printful_product_ids: [], ended_at: new Date(), has_failed: true })
|
||||
.set({ syncing_p_product_ids: [], ended_at: new Date(), has_failed: true })
|
||||
.where("id", "=", activeSync.id)
|
||||
.execute();
|
||||
await this.start(queuedSync);
|
||||
@@ -117,7 +117,7 @@ class SyncService {
|
||||
else {
|
||||
if (id) {
|
||||
await db.updateTable("product_syncs")
|
||||
.set({ syncing_printful_product_ids: [], ended_at: new Date(), has_failed: true })
|
||||
.set({ syncing_p_product_ids: [], ended_at: new Date(), has_failed: true })
|
||||
.where("id", "=", id)
|
||||
.execute();
|
||||
freedSlot = true;
|
||||
@@ -173,7 +173,7 @@ class SyncQueueService {
|
||||
const values: Insertable<ProductSyncs> = {
|
||||
session_id: queuedSync.session.id,
|
||||
session_name: queuedSync.session.name,
|
||||
printful_product_id_filter: queuedSync.filter?.printfulProductIds ?? null
|
||||
p_product_id_filter: queuedSync.filter?.pProductIds ?? null
|
||||
};
|
||||
if (queuedSync.id) {
|
||||
await db.updateTable("product_syncs")
|
||||
@@ -204,7 +204,7 @@ class SyncQueueService {
|
||||
name: result.session_name
|
||||
},
|
||||
filter: {
|
||||
printfulProductIds: result.printful_product_id_filter
|
||||
pProductIds: result.p_product_id_filter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user