@unchainedshop/platform 4.8.14 → 4.8.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,10 +19,13 @@ export async function setupWorkqueue({ unchainedAPI, migrationRepository, ...wor
19
19
  handler.start();
20
20
  });
21
21
  if (workQueueOptions.invalidateProviders ?? !UNCHAINED_DISABLE_PROVIDER_INVALIDATION) {
22
- const orders = await unchainedAPI.modules.orders.findCartsToInvalidate(workQueueOptions.providerInvalidationMaxAgeDays);
23
- await Promise.allSettled(orders.map(async (order) => {
24
- await unchainedAPI.services.orders.updateCalculation(order._id);
25
- }));
22
+ await unchainedAPI.modules.worker.addWorkIfNotExists({
23
+ type: 'INVALIDATE_CARTS',
24
+ input: workQueueOptions.providerInvalidationMaxAgeDays !== undefined
25
+ ? { maxAgeDays: workQueueOptions.providerInvalidationMaxAgeDays }
26
+ : {},
27
+ retries: 0,
28
+ }, () => true);
26
29
  }
27
30
  if (workQueueOptions.assignCartForUsers ?? Boolean(UNCHAINED_ASSIGN_CART_FOR_USERS)) {
28
31
  const users = await unchainedAPI.modules.users.findUsers({});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unchainedshop/platform",
3
3
  "description": "Complete e-commerce platform bundle for the Unchained Engine",
4
- "version": "4.8.14",
4
+ "version": "4.8.16",
5
5
  "main": "lib/platform-index.js",
6
6
  "types": "lib/platform-index.d.ts",
7
7
  "type": "module",