decord/source/971_flushWithTimeout.js

94 lines
2.7 KiB
JavaScript
Raw Normal View History

2026-07-20 16:05:17 +00:00
// Module ID: 971
2026-07-23 10:11:24 +00:00
// Function ID: 10466
2026-07-20 16:05:17 +00:00
// Name: flushWithTimeout
2026-07-23 10:11:24 +00:00
// Dependencies: [5, 801, 845, 798, 970]
2026-07-20 16:05:17 +00:00
// Exports: flushIfServerless
// Module 971 (flushWithTimeout)
2026-07-23 10:11:24 +00:00
import asyncGeneratorStep from "asyncGeneratorStep";
2026-07-20 16:05:17 +00:00
function flushWithTimeout(arg0) {
return _flushWithTimeout(...arguments);
}
async function _flushWithTimeout(arg0, arg1) {
2026-07-23 10:11:24 +00:00
const debug = outer2_0(outer2_1[1]).debug;
2026-07-20 16:05:17 +00:00
debug.log("Flushing events...");
2026-07-23 10:11:24 +00:00
yield outer2_0(outer2_1[2]).flush(arg0);
const debug2 = outer2_0(outer2_1[1]).debug;
2026-07-20 16:05:17 +00:00
debug2.log("Done flushing events");
}
async function _flushIfServerless() {
if (arguments.length > 0) {
if (undefined !== arguments[0]) {
let first = arguments[0];
}
const timeout = first.timeout;
let num = 2000;
if (undefined !== timeout) {
num = timeout;
}
if ("cloudflareWaitUntil" in first) {
let cloudflareWaitUntil;
if (null != first) {
cloudflareWaitUntil = first.cloudflareWaitUntil;
}
if ("function" === typeof cloudflareWaitUntil) {
2026-07-23 10:11:24 +00:00
first.cloudflareWaitUntil(outer2_3(num));
2026-07-20 16:05:17 +00:00
}
}
if ("cloudflareCtx" in first) {
const cloudflareCtx = first.cloudflareCtx;
let waitUntil;
if (null != cloudflareCtx) {
waitUntil = cloudflareCtx.waitUntil;
}
if ("function" === typeof waitUntil) {
const cloudflareCtx2 = first.cloudflareCtx;
2026-07-23 10:11:24 +00:00
cloudflareCtx2.waitUntil(outer2_3(num));
2026-07-20 16:05:17 +00:00
}
}
const _Symbol = Symbol;
2026-07-23 10:11:24 +00:00
if (outer2_0(outer2_1[3]).GLOBAL_OBJ[Symbol.for(Symbol, "@vercel/request-context")]) {
outer2_0(outer2_1[4]).vercelWaitUntil(outer2_3(num));
const obj2 = outer2_0(outer2_1[4]);
2026-07-20 16:05:17 +00:00
} else {
const _process = process;
let tmp8 = "undefined" !== typeof process;
if (tmp8) {
const _process2 = process;
let NETLIFY = process.env.FUNCTIONS_WORKER_RUNTIME;
if (!NETLIFY) {
const _process3 = process;
NETLIFY = process.env.LAMBDA_TASK_ROOT;
}
if (!NETLIFY) {
const _process4 = process;
NETLIFY = process.env.K_SERVICE;
}
if (!NETLIFY) {
const _process5 = process;
NETLIFY = process.env.CF_PAGES;
}
if (!NETLIFY) {
const _process6 = process;
NETLIFY = process.env.VERCEL;
}
if (!NETLIFY) {
const _process7 = process;
NETLIFY = process.env.NETLIFY;
}
tmp8 = NETLIFY;
}
if (tmp8) {
2026-07-23 10:11:24 +00:00
return yield outer2_3(num);
2026-07-20 16:05:17 +00:00
}
}
}
first = {};
}
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
export const flushIfServerless = function flushIfServerless() {
return _flushIfServerless(...arguments);
};