From 792b3d29fa8f31dbe03504bcdc44e39069ca768e Mon Sep 17 00:00:00 2001 From: Mahdi Date: Sat, 10 Oct 2026 17:11:51 +0330 Subject: [PATCH] Montify: allow restarting stuck sync from UI; log sync progress --- apps/api/src/integrations/montify/sync.service.ts | 8 ++++++++ apps/web/src/views/MontifySettingsView.vue | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/api/src/integrations/montify/sync.service.ts b/apps/api/src/integrations/montify/sync.service.ts index 21d6dc7..d286e4b 100644 --- a/apps/api/src/integrations/montify/sync.service.ts +++ b/apps/api/src/integrations/montify/sync.service.ts @@ -236,9 +236,13 @@ export class MontifySyncService { : undefined; let page = 1; let lastPage = 1; + this.logger.log(`Montify sync ${row.id} (${row.label}) start ${mode}${updatedAfter ? ` after ${updatedAfter}` : ''}`); do { const res = await client.listCustomers({ page, limit: CUSTOMER_PAGE_SIZE, updatedAfter }); lastPage = res.meta.last_page; + this.logger.log( + `Montify sync ${row.id} page ${page}/${lastPage}: ${res.data.length} customers (total ${res.meta.total})`, + ); for (const customer of res.data) { result.customersFetched += 1; try { @@ -276,6 +280,10 @@ export class MontifySyncService { ); result.finishedAt = new Date().toISOString(); result.errors = [...missing, ...result.errors].slice(0, 50); + this.logger.log( + `Montify sync ${row.id} done: ${result.customersFetched} customers, ${result.ordersFetched} orders, ` + + `${result.transactionsFetched} transactions, ${result.errors.length} errors${fatal ? ` — fatal: ${fatal}` : ''}`, + ); await this.prisma.montifyConnection.update({ where: { id: row.id }, data: { diff --git a/apps/web/src/views/MontifySettingsView.vue b/apps/web/src/views/MontifySettingsView.vue index 5efb25a..55965ff 100644 --- a/apps/web/src/views/MontifySettingsView.vue +++ b/apps/web/src/views/MontifySettingsView.vue @@ -321,7 +321,7 @@ onBeforeUnmount(() => { همگام‌سازی @@ -329,7 +329,7 @@ onBeforeUnmount(() => { همگام‌سازی کامل