MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / fetchBindFailStats

Function fetchBindFailStats

static/js/payment.js:2204–2235  ·  view source on GitHub ↗
(accountIds = [])

Source from the content-addressed store, hash-verified

2202
2203// 加载账号列表
2204async function fetchBindFailStats(accountIds = []) {
2205 const ids = (Array.isArray(accountIds) ? accountIds : [])
2206 .map((item) => Number(item))
2207 .filter((item) => Number.isFinite(item) && item > 0);
2208 if (!ids.length) {
2209 return new Map();
2210 }
2211 try {
2212 const data = await api.post("/payment/bind-card/tasks/fail-stats", {
2213 account_ids: ids,
2214 }, {
2215 timeoutMs: 12000,
2216 retry: 0,
2217 silentNetworkError: true,
2218 silentTimeoutError: true,
2219 requestKey: "payment:bind-fail-stats",
2220 cancelPrevious: true,
2221 priority: "high",
2222 });
2223 const rows = Array.isArray(data?.stats) ? data.stats : [];
2224 const map = new Map();
2225 rows.forEach((row) => {
2226 const accountId = Number(row?.account_id || 0);
2227 const failCount = Number(row?.fail_count || 0);
2228 if (!Number.isFinite(accountId) || accountId <= 0) return;
2229 map.set(accountId, Number.isFinite(failCount) && failCount > 0 ? failCount : 0);
2230 });
2231 return map;
2232 } catch (_e) {
2233 return new Map();
2234 }
2235}
2236
2237async function loadAccounts() {
2238 try {

Callers 1

loadAccountsFunction · 0.85

Calls 2

filterMethod · 0.45
postMethod · 0.45

Tested by

no test coverage detected