Cleanup terminology
This commit is contained in:
@@ -59,7 +59,7 @@ class ProductSyncService {
|
||||
retry: { limit: 3, delayMs: 10000 },
|
||||
concurrency: { limit: 1, timeoutMs: 600000 }
|
||||
},
|
||||
handler: async (id, payload, setState) => {
|
||||
processor: async (id, payload, setState) => {
|
||||
await this.ProductSyncer.run({
|
||||
filter: payload.filter,
|
||||
beforeStep: async (pProductIds: number[]) => {
|
||||
@@ -70,11 +70,12 @@ class ProductSyncService {
|
||||
});
|
||||
}
|
||||
|
||||
async getSessionSyncState(sessionId: string) {
|
||||
async getLatestSyncState(sessionId: string) {
|
||||
const latestSync = await db.selectFrom("events")
|
||||
.select(["started_at", "ended_at", "has_failed", "state"])
|
||||
.where("type", "=", ProductSyncService.EVENT_TYPE)
|
||||
.where(sql<string>`payload->'session'->>'id'`, "=", sessionId)
|
||||
.orderBy(sql`(started_at is not null and ended_at is null)`, "desc")
|
||||
.orderBy("created_at", "desc")
|
||||
.limit(1)
|
||||
.executeTakeFirst();
|
||||
|
||||
Reference in New Issue
Block a user