Files
klz-cables.com/.pnpm-store/v10/files/d3/ea79b571aab6468ac11b44d6721180b52bd6e5be61c9c011595f13f98f341da2c2fa129680a5f6375fe0e8f86cd9f01f4bdd922e3fa3c4a3cb9bccba3a80b3
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

61 lines
1.8 KiB
Plaintext

import { vercelWaitUntil, debug, flush, GLOBAL_OBJ } from '@sentry/core';
import { DEBUG_BUILD } from '../debug-build.js';
/**
* Flushes pending Sentry events with a 2 second timeout and in a way that cannot create unhandled promise rejections.
*/
async function flushSafelyWithTimeout() {
try {
DEBUG_BUILD && debug.log('Flushing events...');
await flush(2000);
DEBUG_BUILD && debug.log('Done flushing events');
} catch (e) {
DEBUG_BUILD && debug.log('Error while flushing events:\n', e);
}
}
/**
* Uses platform-specific waitUntil function to wait for the provided task to complete without blocking.
*/
function waitUntil(task) {
// If deployed on Cloudflare, use the Cloudflare waitUntil function to flush the events
if (isCloudflareWaitUntilAvailable()) {
cloudflareWaitUntil(task);
return;
}
// otherwise, use vercel's
vercelWaitUntil(task);
}
/**
* Gets the Cloudflare context from the global object.
* Relevant to opennext
* https://github.com/opennextjs/opennextjs-cloudflare/blob/b53a046bd5c30e94a42e36b67747cefbf7785f9a/packages/cloudflare/src/cli/templates/init.ts#L17
*/
function _getOpenNextCloudflareContext() {
const openNextCloudflareContextSymbol = Symbol.for('__cloudflare-context__');
return (
GLOBAL_OBJ
)[openNextCloudflareContextSymbol]?.ctx;
}
/**
* Function that delays closing of a Cloudflare lambda until the provided promise is resolved.
*/
function cloudflareWaitUntil(task) {
_getOpenNextCloudflareContext()?.waitUntil(task);
}
/**
* Checks if the Cloudflare waitUntil function is available globally.
*/
function isCloudflareWaitUntilAvailable() {
return typeof _getOpenNextCloudflareContext()?.waitUntil === 'function';
}
export { cloudflareWaitUntil, flushSafelyWithTimeout, isCloudflareWaitUntilAvailable, waitUntil };
//# sourceMappingURL=responseEnd.js.map