decord/source/modules/errors/CommonSentryInitUtils.tsx

42 lines
1.6 KiB
TypeScript
Raw Normal View History

// Module ID: 1357
// Function ID: 1358
// Name: CommonSentryInitUtils
2026-07-23 10:11:24 +00:00
// Dependencies: [2]
2026-07-20 16:05:17 +00:00
// Exports: filterThrottle
// Module 1357 (CommonSentryInitUtils)
import size from "module_2" /* 2 */;
2026-08-24 06:08:38 +00:00
const result = size.fileFinishedImporting("modules/errors/CommonSentryInitUtils.tsx");
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
export const IGNORE_ANALYTICS_BREADCRUMB_EVENTS = ["notification_clicked", "experiment_user_triggered", "experiment_dm_triggered", "experiment_guild_triggered", "device_event", "react_soft_exception", "network_capabilities_changed", "foreground_service", "app_lifecycle", "ui_lifecycle", "touch_event", "http_request", "websocket_message_received"];
2026-07-20 16:05:17 +00:00
export const filterThrottle = function filterThrottle(arg0) {
({ maxBudgetMinute: closure_0, maxBudgetHour: closure_1 } = arg0);
let minute = { minute: { slot: 0, budgetUsed: 0 }, hour: { slot: 0, budgetUsed: 0 } };
2026-07-20 16:05:17 +00:00
return () => {
const timestamp = Date.now();
const rounded = Math.round(timestamp / 1000 / 60);
const rounded1 = Math.round(timestamp / 1000 / 60 / 60);
2026-07-29 08:29:29 +00:00
if (minute.minute.slot !== rounded) {
tmp4.minute.slot = rounded;
tmp4.minute.budgetUsed = 0;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (minute.hour.slot !== rounded1) {
tmp4.hour.slot = rounded1;
tmp4.hour.budgetUsed = 0;
2026-07-20 16:05:17 +00:00
}
let flag = tmp4.minute.budgetUsed < closure_1_0;
2026-07-20 16:05:17 +00:00
if (flag) {
2026-07-29 08:29:29 +00:00
minute = tmp4.minute;
2026-07-20 16:05:17 +00:00
minute.budgetUsed = minute.budgetUsed + 1;
flag = tmp4.hour.budgetUsed < closure_1_1;
2026-07-20 16:05:17 +00:00
}
if (flag) {
2026-07-29 08:29:29 +00:00
const hour = tmp4.hour;
2026-07-20 16:05:17 +00:00
hour.budgetUsed = hour.budgetUsed + 1;
flag = true;
}
return flag;
};
};