Release 1.2.2: recover missed PrestaShop status changes

This commit is contained in:
fatequod
2026-10-08 10:57:21 +02:00
parent 86cf1a232f
commit d140625ba0
11 changed files with 401 additions and 19 deletions
+5 -1
View File
@@ -10,7 +10,7 @@ const { registerPrestashopPermissions } = require('./src/register-permissions');
const { importOrdersForShop, syncPaymentsForShop } = require('./src/automation-jobs');
const { createJobRuntime } = require('./src/job-runtime');
const { ensureShopIcon } = require('./src/shop-icon');
const { registerStatusSyncHook } = require('./src/status-sync');
const { registerStatusSyncHook, reconcileOrderStatuses } = require('./src/status-sync');
const NEW_ORDERS_WINDOW_MS = 20 * 60 * 1000;
// TTL locków cronowych w sekundach (jednostka oczekiwana przez Core.getLock/Core.extendLockTime).
@@ -82,6 +82,10 @@ async function syncShopIcon() {
}
const jobs = [
new CronJob('15 * * * * *', () => runtime.track(() =>
runtime.withRenewedLock('prestashop-status-reconciliation', JOB_LOCK_TTL_SECONDS, valid =>
reconcileOrderStatuses({ Core, Log, PsOrder, loadConfig, apiFor }, valid))
).catch(error => Log.error('PrestaShop status reconciliation worker failed', { error: error?.message }))),
new CronJob('0 * * * * *', () => runtime.track(() =>
runtime.withRenewedLock('prestashop-orders-puller', JOB_LOCK_TTL_SECONDS, runOrdersPuller)
)),