feat(sync): harden the Hiboutik sync, share rate limits across instances, update dependencies (#4)

This commit is contained in:
2026-11-08 13:45:08 +00:00
parent 04960379e8
commit d07c4df52d
62 changed files with 1546 additions and 639 deletions

View File

@@ -1,7 +1,9 @@
import { Logger } from '@nestjs/common';
import { rethrowIfRateLimited } from '../hiboutik/hiboutik.client';
/**
* Runs `action` on each item, one at a time: a failing item is logged and skipped, the others are still processed.
* A Hiboutik rate limit error stops the loop (rethrown): the next items would fail the same way.
* @param items
* @param action
* @param logger
@@ -19,6 +21,7 @@ export async function forEachSafely<T>(
try {
await action(item);
} catch (error) {
rethrowIfRateLimited(error);
nbFailed++;
logger.error(`Failed to sync ${describe(item)}`, (error as Error)?.stack);
}