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:
@@ -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))
|
||||
)),
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user