Skip to content

Commit 829b2cf

Browse files
committed
ref: return void
1 parent 8e16917 commit 829b2cf

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

packages/core/src/utils/cloudflareWaitUntil.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const CloudflareContextKey = '__cloudflare-context__';
1010
/**
1111
* Function that delays closing of a Cloudflare lambda until the provided promise is resolved.
1212
*/
13-
export function cloudflareWaitUntil(task: Promise<unknown>): boolean {
13+
export function cloudflareWaitUntil(task: Promise<unknown>): void {
1414
try {
1515
const cfContextSymbol = Symbol.for(CloudflareContextKey);
1616
const globalWithCfContext = GLOBAL_OBJ as typeof GLOBAL_OBJ & {
@@ -22,14 +22,9 @@ export function cloudflareWaitUntil(task: Promise<unknown>): boolean {
2222
const context = globalWithCfContext[cfContextSymbol].ctx;
2323

2424
if (typeof context.waitUntil === 'function') {
25-
// eslint-disable-next-line no-console
26-
console.log('flushing with cf');
2725
context.waitUntil(task);
28-
return true;
2926
}
30-
31-
return false;
3227
} catch {
33-
return false;
28+
// Ignore errors
3429
}
3530
}

packages/core/src/utils/flushIfServerless.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,8 @@ export async function flushIfServerless(
5757
// @ts-expect-error This is not typed
5858
if (GLOBAL_OBJ[Symbol.for(CloudflareContextKey)]) {
5959
// If the cloudflareWaitUntil function is available, use it to flush the events, if not then fallback to the regular flush
60-
if (cloudflareWaitUntil(flushWithTimeout(timeout))) {
61-
return;
62-
}
60+
cloudflareWaitUntil(flushWithTimeout(timeout));
61+
return;
6362
}
6463

6564
if (typeof process === 'undefined') {

0 commit comments

Comments
 (0)