chore: upgrade @orbito/api-lib to 3.3.3

Lock TTL is now passed in seconds, matching what the core lock RPC methods
expect and what the 3.x SDK documents as ttlSeconds.

The presta-api timeout test no longer drains the event loop: it drives the
unref-ed timeout timer through node:test mock timers instead of real ones.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LpoFvfAbnMmkSJFRc867XA
This commit is contained in:
2026-09-10 12:04:32 +02:00
co-authored by Claude Opus 5
parent ac64072f1b
commit 7e84524714
6 changed files with 57 additions and 15 deletions
+5 -3
View File
@@ -12,6 +12,8 @@ const { createJobRuntime } = require('./src/job-runtime');
const { ensureShopIcon } = require('./src/shop-icon');
const NEW_ORDERS_WINDOW_MS = 20 * 60 * 1000;
// TTL locków cronowych w sekundach (jednostka oczekiwana przez Core.getLock/Core.extendLockTime).
const JOB_LOCK_TTL_SECONDS = 5 * 60;
const runtime = createJobRuntime(Core, Log);
Utils.loadMethods(__dirname + '/methods');
@@ -75,13 +77,13 @@ async function syncShopIcon() {
const jobs = [
new CronJob('0 */5 * * * *', () => runtime.track(() =>
runtime.withRenewedLock('prestashop-orders-puller', 5 * 60 * 1000, runOrdersPuller)
runtime.withRenewedLock('prestashop-orders-puller', JOB_LOCK_TTL_SECONDS, runOrdersPuller)
)),
new CronJob('0 */3 * * * *', () => runtime.track(() =>
runtime.withRenewedLock('prestashop-payments-sync', 5 * 60 * 1000, valid => runPaymentSync('recent', valid))
runtime.withRenewedLock('prestashop-payments-sync', JOB_LOCK_TTL_SECONDS, valid => runPaymentSync('recent', valid))
)),
new CronJob('30 */30 * * * *', () => runtime.track(() =>
runtime.withRenewedLock('prestashop-payments-sync', 5 * 60 * 1000, valid => runPaymentSync('older', valid))
runtime.withRenewedLock('prestashop-payments-sync', JOB_LOCK_TTL_SECONDS, valid => runPaymentSync('older', valid))
)),
];